Skip to content

Commit

Permalink
Using resource.model_name.human as default resource name
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiokr committed May 29, 2011
1 parent 3bbe4ca commit 8e75b2e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/active_admin/resource.rb
Expand Up @@ -72,9 +72,14 @@ def camelized_resource_name
underscored_resource_name.camelize
end

# Returns the name to call this resource
# Returns the name to call this resource.
# By default will use resource.model_name.human
def resource_name
@resource_name ||= underscored_resource_name.titleize
@resource_name ||= if @options[:as] || !resource.respond_to?(:model_name)
underscored_resource_name.titleize
else
resource.model_name.human.titleize
end
end

# Returns the plural version of this resource
Expand Down

0 comments on commit 8e75b2e

Please sign in to comment.