Skip to content

Commit

Permalink
Merge pull request activeadmin#1324 from Daxter/custom-title-for-index
Browse files Browse the repository at this point in the history
Allow custom title for Index pages
  • Loading branch information
pcreux committed May 16, 2012
2 parents 9ff1ba6 + baba30b commit e3c6b05
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
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"
6 changes: 5 additions & 1 deletion lib/active_admin/views/pages/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ module Pages
class Index < Base

def title
active_admin_config.plural_resource_label
if config[:title].is_a? String
config[:title]
else
active_admin_config.plural_resource_label
end
end

def config
Expand Down

0 comments on commit e3c6b05

Please sign in to comment.