Class: OrdinaryCms::PagesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- OrdinaryCms::PagesController
- Includes:
- SmartPagesRender
- Defined in:
- app/controllers/ordinary_cms/pages_controller.rb
Instance Method Summary collapse
Methods included from SmartPagesRender
Instance Method Details
#show ⇒ Object
10 11 12 |
# File 'app/controllers/ordinary_cms/pages_controller.rb', line 10 def show smart_render(@page.slug) end |
#update ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/ordinary_cms/pages_controller.rb', line 14 def update sections_keys = params[:content].keys - [:undefined] sections_keys.each do |key| section_name = key.gsub '_title', '' attr = (section_name == key) ? 'content' : 'alias' section = @page.section(section_name) section.update_attributes attr => params[:content][key][:value] unless section.nil? end render text: '' end |