Class: Spree::Admin::PagesController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Spree::Admin::PagesController
- Defined in:
- app/controllers/spree/admin/pages_controller.rb
Instance Method Summary collapse
Instance Method Details
#location_after_save ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/controllers/spree/admin/pages_controller.rb', line 3 def location_after_save case params[:action] when "create" edit_admin_page_content_path(@page, @page.contents.first) else admin_page_path(@page) end end |
#update_positions ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/spree/admin/pages_controller.rb', line 12 def update_positions params[:positions].each do |id, index| Spree::Page.update_all(['position=?', index], ['id=?', id]) end respond_to do |format| format.html { redirect_to admin_pages_path } format.js { render :text => 'Ok' } end end |