Permalink
Browse files

Use display name by default if it exists

  • Loading branch information...
1 parent c183c89 commit 4a0da8db426c267ea5f5f24b3009514327af01d8 Amiel Martin committed Feb 29, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/active_admin/views/pages/show.rb
@@ -36,7 +36,11 @@ def attributes_table(*args, &block)
protected
def default_title
- "#{active_admin_config.resource_label} ##{resource.id}"
+ if resource.respond_to?(:display_name)
+ resource.display_name
+ else
+ "#{active_admin_config.resource_label} ##{resource.id}"
+ end
end
module DefaultMainContent

0 comments on commit 4a0da8d

Please sign in to comment.