Class: Weeler::StaticSectionsController
- Inherits:
-
ContentController
- Object
- ApplicationController
- ApplicationController
- BaseController
- ContentController
- Weeler::StaticSectionsController
- Defined in:
- app/controllers/weeler/static_sections_controller.rb
Instance Method Summary collapse
Methods inherited from ContentController
Instance Method Details
#show ⇒ Object
3 4 5 6 |
# File 'app/controllers/weeler/static_sections_controller.rb', line 3 def show @section = params[:id] @items = Weeler.static_sections[@section.to_sym] end |
#update ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/weeler/static_sections_controller.rb', line 8 def update params[:translations].each do |translation| id, value = translation.first, translation.last translation = I18n::Backend::Weeler::Translation.find(id) translation.value = value translation.save end Setting.i18n_updated_at = Time.current redirect_to({ action: :show, id: params[:id] }, { flash: { success: "Section updated." } }) end |