Class: PagesController
- Inherits:
-
SlicesController
- Object
- ActionController::Base
- SlicesController
- PagesController
- Defined in:
- app/controllers/pages_controller.rb
Instance Method Summary collapse
Methods inherited from SlicesController
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/pages_controller.rb', line 14 def create page = Page.find_by_path(request.path) raise Page::NotFound unless page.active? slice = post_slice(page) if slice.handle_post(params) slice.(flash) redirect_to(slice.redirect_url) else render_page(page) end end |
#show ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/controllers/pages_controller.rb', line 26 def show page = nil benchmark 'Page.find_by_path' do page = Page.find_by_path(request.path) raise Page::NotFound unless page.active? end render_page(page) end |
#virtual_error_pages ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'app/controllers/pages_controller.rb', line 5 def virtual_error_pages role = Page.role_for_status(params[:status]) if role render_page(Page.find_virtual(role), 200) # page is only cached if status is 200 else raise Page::NotFound.new(request.path) end end |