Class: Spina::Admin::NavigationsController
- Inherits:
-
AdminController
- Object
- ActionController::Base
- Spina::ApplicationController
- AdminController
- Spina::Admin::NavigationsController
- Defined in:
- app/controllers/spina/admin/navigations_controller.rb
Instance Method Summary collapse
Methods inherited from AdminController
Instance Method Details
#edit ⇒ Object
13 14 15 16 17 |
# File 'app/controllers/spina/admin/navigations_controller.rb', line 13 def edit @navigation.label, spina.(@navigation) t('spina.edit') render layout: 'spina/admin/admin' end |
#show ⇒ Object
9 10 11 |
# File 'app/controllers/spina/admin/navigations_controller.rb', line 9 def show t('spina.website.pages') end |
#sort ⇒ Object
27 28 29 30 31 32 33 |
# File 'app/controllers/spina/admin/navigations_controller.rb', line 27 def sort params[:list].each_pair do |parent_pos, parent_node| update_child_pages_position(parent_node) (parent_node[:id], parent_pos, nil) end head :ok end |
#update ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/controllers/spina/admin/navigations_controller.rb', line 19 def update if @navigation.update() redirect_to spina.(@navigation) else render :edit end end |