page model and starting resource

This commit is contained in:
2022-11-25 14:46:49 +02:00
parent 58259c4b15
commit beaae6cb32
11 changed files with 79 additions and 6 deletions

View File

@ -0,0 +1,10 @@
= form_for @cms_page do |f|
- if @cms_page.errors.any?
#error_explanation
%h2= "#{pluralize(@cms_page.errors.count, "error")} prohibited this cms_page from being saved:"
%ul
- @cms_page.errors.full_messages.each do |message|
%li= message
.actions
= f.submit 'Save'

View File

@ -0,0 +1,7 @@
%h1 Editing cms_page
= render 'form'
= link_to 'Show', @cms_page
\|
= link_to 'Back', cms_pages_path

View File

@ -0,0 +1,21 @@
%h1 Listing cms_pages
%table
%thead
%tr
%th
%th
%th
%tbody
- @cms_pages.each do |cms_page|
%tr
=cms_page.id
%tr
%td= link_to 'Show', cms_page
%td= #link_to 'Edit', edit_cms_page_path(cms_page)
%td= link_to 'Destroy', cms_page, method: :delete, data: { confirm: 'Are you sure?' }
%br
= link_to 'New Page', new_cms_page_path

View File

@ -0,0 +1,5 @@
%h1 New cms_page
= render 'form'
= link_to 'Back', cms_pages_path

View File

@ -0,0 +1,6 @@
%p#notice= notice
= link_to 'Edit', edit_cms_page_path(@cms_page)
\|
= link_to 'Back', cms_pages_path