page model and starting resource
This commit is contained in:
10
app/views/cms/pages/_form.html.haml
Normal file
10
app/views/cms/pages/_form.html.haml
Normal 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'
|
7
app/views/cms/pages/edit.html.haml
Normal file
7
app/views/cms/pages/edit.html.haml
Normal file
@ -0,0 +1,7 @@
|
||||
%h1 Editing cms_page
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Show', @cms_page
|
||||
\|
|
||||
= link_to 'Back', cms_pages_path
|
21
app/views/cms/pages/index.html.haml
Normal file
21
app/views/cms/pages/index.html.haml
Normal 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
|
5
app/views/cms/pages/new.html.haml
Normal file
5
app/views/cms/pages/new.html.haml
Normal file
@ -0,0 +1,5 @@
|
||||
%h1 New cms_page
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Back', cms_pages_path
|
6
app/views/cms/pages/show.html.haml
Normal file
6
app/views/cms/pages/show.html.haml
Normal file
@ -0,0 +1,6 @@
|
||||
%p#notice= notice
|
||||
|
||||
|
||||
= link_to 'Edit', edit_cms_page_path(@cms_page)
|
||||
\|
|
||||
= link_to 'Back', cms_pages_path
|
Reference in New Issue
Block a user