lib/active_admin/resource.rb in activeadmin-0.2.1 vs lib/active_admin/resource.rb in activeadmin-0.2.2
- old
+ new
@@ -80,10 +80,14 @@
# Returns the plural version of this resource
def plural_resource_name
@plural_resource_name ||= resource_name.pluralize
end
+ def resource_table_name
+ resource.table_name
+ end
+
# Returns a properly formatted controller name for this
# resource within its namespace
def controller_name
[namespace.module_name, camelized_resource_name.pluralize + "Controller"].compact.join('::')
end
@@ -119,19 +123,20 @@
# Returns the name to put this resource under in the menu
def parent_menu_item_name
@menu_options[:parent]
end
+ # Returns the name to be displayed in the menu for this resource
+ def menu_item_name
+ @menu_options[:label] || plural_resource_name
+ end
+
# Should this resource be added to the menu system?
def include_in_menu?
return false if @menu_options[:display] == false
!(belongs_to? && !belongs_to_config.optional?)
end
- # Returns the name to be displayed in the menu for this resource
- def menu_item_name
- @menu_item_name ||= plural_resource_name
- end
# Clears all the member actions this resource knows about
def clear_member_actions!
@member_actions = []
end