Skip to content

Commit

Permalink
added cukes and slimmed down index title functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlinsley committed May 15, 2012
1 parent e36766b commit baba30b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 12 additions & 0 deletions features/index/page_title.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Feature: Index - Page Title

Modifying the page title on the index screen

Scenario: Set a string as the title
Given an index configuration of:
"""
ActiveAdmin.register Post do
index :title => "Awesome Title"
end
"""
Then I should see the page title "Awesome Title"
5 changes: 1 addition & 4 deletions lib/active_admin/views/pages/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ module Pages
class Index < Base

def title
case config[:title]
when Symbol, Proc
call_method_or_proc_on(resource, config[:title])
when String
if config[:title].is_a? String
config[:title]
else
active_admin_config.plural_resource_label
Expand Down

0 comments on commit baba30b

Please sign in to comment.