Skip to content

Instantly share code, notes, and snippets.

@itsterry
Created December 16, 2011 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsterry/1488300 to your computer and use it in GitHub Desktop.
Save itsterry/1488300 to your computer and use it in GitHub Desktop.
Customize page title on active admin index pages
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
@fro
Copy link

fro commented Feb 21, 2012

Hi, where do you define the :page_title property: In the controller ?
Thx

@fro
Copy link

fro commented Feb 21, 2012

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.. :-)

@itsterry
Copy link
Author

Hmm. Don't know where you'd do that dynamically. The method above is just for a static string I think

@fro
Copy link

fro commented Feb 22, 2012

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