Sha256: 2694bee9093be3429552cca63df532d15bbe1981b125445463ffc499e21e9e69

Contents?: true

Size: 640 Bytes

Versions: 13

Compression:

Stored size: 640 Bytes

Contents

# Module designed to work with `acts_as_list`.

require 'active_support/concern'

module Admin
  module ActsAsList

    extend ActiveSupport::Concern

    included do
      before_filter :get_object, :only => [:position]
      before_filter :check_resource_ownership, :only => [:position]
    end

    def position
      if %w(move_to_top move_higher move_lower move_to_bottom).include?(params[:go])
        @item.send(params[:go])
        notice = Typus::I18n.t("%{model} successfully updated.", :model => @resource.model_name.human)
        redirect_to :back, :notice => notice
      else
        not_allowed
      end
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
brainsome_typus-4.0.0.beta13 app/controllers/concerns/admin/acts_as_list.rb
brainsome_typus-4.0.0.beta12 app/controllers/concerns/admin/acts_as_list.rb
brainsome_typus-4.0.0.beta11 app/controllers/concerns/admin/acts_as_list.rb
brainsome_typus-4.0.0.beta10 app/controllers/concerns/admin/acts_as_list.rb
brainsome_typus-4.0.0.beta9 app/controllers/concerns/admin/acts_as_list.rb
brainsome_typus-4.0.0.beta8 app/controllers/concerns/admin/acts_as_list.rb
brainsome_typus-4.0.0.beta7 app/controllers/concerns/admin/acts_as_list.rb
brainsome_typus-4.0.0.beta6 app/controllers/concerns/admin/acts_as_list.rb
brainsome_typus-4.0.0.beta5 app/controllers/concerns/admin/acts_as_list.rb
brainsome_typus-4.0.0.beta4 app/controllers/concerns/admin/acts_as_list.rb
brainsome_typus-4.0.0.beta3 app/controllers/concerns/admin/acts_as_list.rb
brainsome_typus-4.0.0.beta2 app/controllers/concerns/admin/acts_as_list.rb
brainsome_typus-4.0.0.beta1 app/controllers/concerns/admin/acts_as_list.rb