Class: MinimalistCms::PagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- MinimalistCms::PagesController
- Defined in:
- app/controllers/minimalist_cms/pages_controller.rb
Instance Method Summary collapse
Instance Method Details
#show ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/controllers/minimalist_cms/pages_controller.rb', line 3 def show @page = if params[:id].present? Page.find_by_slug(params[:id]) else Page.find_by_home(true) end raise ActionController::RoutingError.new('Page Not Found') if @page.nil? end |
#update ⇒ Object
12 13 14 15 16 |
# File 'app/controllers/minimalist_cms/pages_controller.rb', line 12 def update @page = Page.find(params[:id]) @page.update_attribute(:body, params[:body]) render json: @page end |