Sha256: a9fc5efe4e94aa270cdad436c37b6c6a1fa77d41358dab982a372d23a15df26d
Contents?: true
Size: 639 Bytes
Versions: 30
Compression:
Stored size: 639 Bytes
Contents
module Controller module ActsAsListConcern extend ActiveSupport::Concern def reposition @resource = load_resource @dropped_resource = resource_class.find(params[:dropped_id]) @dropped_resource.set_list_position(@resource.position) position = @dropped_resource.position < @resource.position ? :before : :after redirect_to collection_path, notice: I18n.t("acts_as_list.inserted_#{position}", target_resource: @resource.try_all(*Itsf::Backend::Configuration.resource_title_methods), inserted_resource: @dropped_resource.try_all(*Itsf::Backend::Configuration.resource_title_methods)) end end end
Version data entries
30 entries across 30 versions & 1 rubygems