Class: PagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- PagesController
- Defined in:
- lib/generators/frame/admin/templates/app/controllers/pages_controller.rb
Instance Method Summary collapse
-
#show ⇒ Object
GET /pages/1 GET /pages/1.json.
Instance Method Details
#show ⇒ Object
GET /pages/1 GET /pages/1.json
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/generators/frame/admin/templates/app/controllers/pages_controller.rb', line 5 def show if params[:id] == 0 @page = Page.find_by_name('home') || Page.first else @page = Page.find(params[:id]) end respond_to do |format| # show.html.erb if @page format.html format.json { render json: @page } else format.html { redirect_to :admin_root } format.json { render json: @page.errors, status: :unprocessable_entity } end end end |