Module: Para::Helpers::ResourceName
- Included in:
- Admin::SearchController, ApplicationHelper, AttributeField::RelationField, Breadcrumbs::Breadcrumb, Inputs::MultiSelectInput
- Defined in:
- lib/para/helpers/resource_name.rb
Instance Method Summary collapse
Instance Method Details
#resource_name(resource) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/para/helpers/resource_name.rb', line 4 def resource_name(resource) Para.config.resource_name_methods.each do |method| return resource.send(method) if resource.respond_to?(method) end model_name = resource.class.model_name.human "#{ model_name } - #{ resource.id }" end |