diff --git a/features/index/page_title.feature b/features/index/page_title.feature new file mode 100644 index 00000000000..7952fdb4e3d --- /dev/null +++ b/features/index/page_title.feature @@ -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" diff --git a/lib/active_admin/views/pages/index.rb b/lib/active_admin/views/pages/index.rb index aaf76ae3378..df635679116 100644 --- a/lib/active_admin/views/pages/index.rb +++ b/lib/active_admin/views/pages/index.rb @@ -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