Skip to content

Commit

Permalink
Build admin paths using model_name helper
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinClowers committed Mar 13, 2017
1 parent 398889f commit 7b77de9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ex_admin/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ defmodule ExAdmin.Utils do
admin_resource_path(conn.assigns.resource.__struct__, method, args)
end
def admin_resource_path(resource_model, method, args) when is_atom(resource_model) do
resource_name = resource_model |> ExAdmin.Utils.base_name |> Inflex.underscore |> Inflex.pluralize
resource_name = resource_model |> ExAdmin.Helpers.model_name |> Inflex.pluralize
apply(router(), :admin_resource_path, [endpoint(), method || :index, resource_name | args])
end
def admin_resource_path(resource, method, args) when is_map(resource) do
Expand Down

0 comments on commit 7b77de9

Please sign in to comment.