Sha256: 93acb386da87de42330a04de1060a223faa4e56218d9556d11de763f2ef7cea6

Contents?: true

Size: 626 Bytes

Versions: 9

Compression:

Stored size: 626 Bytes

Contents

module Spree
  module Admin
    class BannersController < ResourceController
      before_filter :load_data
      
      def update_positions
        params[:positions].each do |id, index|
          Spree::Banner.update_all(['position=?', index], ['id=?', id])
        end

        respond_to do |format|
          format.html { redirect_to admin_banners_url() }
          format.js  { render :text => 'Ok' }
        end
      end
      
      def load_data
        @banners = Spree::Banner.all
      end
      
      private
      def location_after_save
        admin_banners_url(@banner)
      end
      
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spree_banner-1.1.2 app/controllers/spree/admin/banners_controller.rb
spree_banner-1.0.8 app/controllers/spree/admin/banners_controller.rb
spree_banner-1.1.1 app/controllers/spree/admin/banners_controller.rb
spree_banner-1.0.7 app/controllers/spree/admin/banners_controller.rb
spree_banner-1.1.0 app/controllers/spree/admin/banners_controller.rb
spree_banner-1.0.6 app/controllers/spree/admin/banners_controller.rb
spree_banner-1.0.5 app/controllers/spree/admin/banners_controller.rb
spree_banner-1.0.4 app/controllers/spree/admin/banners_controller.rb
spree_banner-1.0.3 app/controllers/spree/admin/banners_controller.rb