Skip to content

Instantly share code, notes, and snippets.

@richardpeng
Forked from francois-ferrandis/active_admin.rb
Last active December 13, 2018 20:05
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 richardpeng/d337b9d104a2787f9adbbaeff57b8e04 to your computer and use it in GitHub Desktop.
Save richardpeng/d337b9d104a2787f9adbbaeff57b8e04 to your computer and use it in GitHub Desktop.
Customize the active admin layout
# config/initializers/active_admin.rb
# ...rest of the initializer here...
module AdminPageLayoutOverride
def build(*args)
# you can move the call to super at the end, if you wish
# to insert things at the begining of the page
super
# this will be added at the end of <body>
within body do
render partial: '...'
end
# this will be added at the end of <head>
within head do
text_node(javascript_include_tag('active_admin'))
end
end
end
ActiveAdmin::Views::Pages::Base.send :prepend, AdminPageLayoutOverride
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment