diff --git a/lib/active_admin/reorderable/table_methods.rb b/lib/active_admin/reorderable/table_methods.rb index b84f836..e075b71 100644 --- a/lib/active_admin/reorderable/table_methods.rb +++ b/lib/active_admin/reorderable/table_methods.rb @@ -11,8 +11,10 @@ def reorder_column private def reorder_handle_for(resource) - aa_resource = active_admin_namespace.resource_for(resource.class) - url = url_for [:reorder, aa_resource.route_prefix, resource] + aa_resource = active_admin_namespace.resource_for(resource.class) + instance_name = aa_resource.resources_configuration[:self][:route_instance_name] + + url = send([:reorder, aa_resource.route_prefix, instance_name, :path].join('_'), resource) span(reorder_handle_content, :class => 'reorder-handle', 'data-reorder-url' => url) end