Skip to content

Commit

Permalink
Fix URL building for nested resources
Browse files Browse the repository at this point in the history
`active_admin_config` only works for the current resource being viewed
and won't work for associated resources. This commit fixes that to use
the active_admin_namespace to look up the resource definition for the
given resource.
  • Loading branch information
zporter committed Feb 15, 2018
1 parent e82efcd commit 3873dd4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/active_admin/reorderable/table_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ def reorder_column
private

def reorder_handle_for(resource)
url = [active_admin_config.route_instance_path(resource), :reorder].join('/')
url = [
active_admin_namespace.resource_for(resource.class).route_instance_path(resource),
:reorder
].join('/')

span(reorder_handle_content, :class => 'reorder-handle', 'data-reorder-url' => url)
end

Expand Down

0 comments on commit 3873dd4

Please sign in to comment.