Created
December 16, 2011 22:27
-
-
Save itsterry/1488300 to your computer and use it in GitHub Desktop.
Customize page title on active admin index pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveAdmin | |
module Views | |
module Pages | |
class Index < Base | |
def title | |
if config[:page_title].blank? | |
active_admin_config.plural_resource_name | |
else | |
config[:page_title] | |
end | |
end | |
end | |
end | |
end | |
end |
I can define the title in the index block as:
index :page_title => controller.set_a_custom_title do
column :id
...
end
But I can't define the set_a_custom_title method in the controller.
Any help appreciated.. :-)
Hmm. Don't know where you'd do that dynamically. The method above is just for a static string I think
Yes... too bad
I've created an issue... I hope there's a nice solution - or even a monkey patch. :-)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, where do you define the :page_title property: In the controller ?
Thx