Sha256: 40754991668fd28879594a0f22f9d5c3b7634fc4a4782c54fe064110ada43cd7

Contents?: true

Size: 651 Bytes

Versions: 13

Compression:

Stored size: 651 Bytes

Contents

module Adminpanel
  module GalleryzableActions
    extend ActiveSupport::Concern

    def move_better
      resource = @model.find(params[:id])
      resource.move_to_better_position
      respond

    end

    def move_worst
      resource = @model.find(params[:id])
      resource.move_to_worst_position
      respond
    end

  private
    def respond
      respond_to do |format|
        format.js do
          render 'shared/gallery_entries', :locals => {
            :collection => @model.where(
              @model.relation_field.to_sym => resource.send(@model.relation_field)
            )
          }
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
adminpanel-2.2.5 app/controllers/concerns/adminpanel/galleryzable_actions.rb
adminpanel-2.2.4 app/controllers/concerns/adminpanel/galleryzable_actions.rb
adminpanel-2.2.3 app/controllers/concerns/adminpanel/galleryzable_actions.rb
adminpanel-2.2.2 app/controllers/concerns/adminpanel/galleryzable_actions.rb
adminpanel-2.2.1 app/controllers/concerns/adminpanel/galleryzable_actions.rb
adminpanel-2.2.0 app/controllers/concerns/adminpanel/galleryzable_actions.rb
adminpanel-2.1.7 app/controllers/concerns/adminpanel/galleryzable_actions.rb
adminpanel-2.1.6 app/controllers/concerns/adminpanel/galleryzable_actions.rb
adminpanel-2.1.5 app/controllers/concerns/adminpanel/galleryzable_actions.rb
adminpanel-2.1.3 app/controllers/concerns/adminpanel/galleryzable_actions.rb
adminpanel-2.1.2 app/controllers/concerns/adminpanel/galleryzable_actions.rb
adminpanel-2.1.1 app/controllers/concerns/adminpanel/galleryzable_actions.rb
adminpanel-2.1.0 app/controllers/concerns/adminpanel/galleryzable_actions.rb