mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Add pages show page.
This commit is contained in:
parent
0bba99e627
commit
ebecb060d8
@ -6,5 +6,6 @@
|
||||
@import 'admin/flash'
|
||||
@import 'admin/menu'
|
||||
@import 'admin/photos'
|
||||
@import 'admin/pages'
|
||||
@import 'admin/simple_form'
|
||||
@import 'admin/unlocks'
|
||||
|
||||
2
app/assets/stylesheets/admin/pages.css.sass
Normal file
2
app/assets/stylesheets/admin/pages.css.sass
Normal file
@ -0,0 +1,2 @@
|
||||
.page
|
||||
max-width: 30em
|
||||
@ -12,6 +12,11 @@ class Admin::PagesController < Admin::AdminController
|
||||
@page = Page.find(params[:id])
|
||||
end
|
||||
|
||||
def show
|
||||
page = Page.find(params[:id])
|
||||
@page = PagePresenter.new(page)
|
||||
end
|
||||
|
||||
def update
|
||||
@page = Page.find(params[:id])
|
||||
|
||||
|
||||
@ -2,5 +2,6 @@
|
||||
%td= page.name
|
||||
%td= page.title
|
||||
%td{ class: :actions }
|
||||
= link_to 'Show', [:admin, page]
|
||||
= link_to 'Edit', edit_admin_page_path(page)
|
||||
= link_to 'Destroy', [:admin, page], confirm: 'Are you sure?', method: :delete
|
||||
|
||||
4
app/views/admin/pages/show.html.haml
Normal file
4
app/views/admin/pages/show.html.haml
Normal file
@ -0,0 +1,4 @@
|
||||
.page
|
||||
%h2= @page.title
|
||||
|
||||
.content= @page.content_as_html
|
||||
Loading…
Reference in New Issue
Block a user