You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I enjoy to use activeadmin, but also I like Gon gem which allow to transport some variables from ruby env to js. Gon requires to render helper method include_gon in view. But active_admin doesn't allow inject some html code into it layout, so I added dirty patch into my initializer https://gist.github.com/jalkoby/ead3b3a1febb2e8248ee.
It uses internal activeadmin and arbre methods with overriding footer builder of any page. It solves the problem, but solution is not good as it could be. I liked to have something like that in active_admin configuration
ActiveAdmin.setupdo |config|
config.view_factory.registerfooter: FooterendclassFooter < ActiveAdmin::Componentbuilder_method:footerdefbuild# you have access to Arbre in hereendend
It is fragile. In ActiveAdmin 2 you need to add a parameter "namespace":
ActiveAdmin.setup do |config|
config.view_factory.register footer: Footer
end
class Footer < ActiveAdmin::Component
builder_method :footer
def build(namespace)
# you have access to Arbre in here
end
end
I enjoy to use activeadmin, but also I like Gon gem which allow to transport some variables from ruby env to js. Gon requires to render helper method
include_gon
in view. But active_admin doesn't allow inject some html code into it layout, so I added dirty patch into my initializer https://gist.github.com/jalkoby/ead3b3a1febb2e8248ee.It uses internal activeadmin and arbre methods with overriding footer builder of any page. It solves the problem, but solution is not good as it could be. I liked to have something like that in active_admin configuration
Is it makes sense for anyone else? Maybe someone suggests more elegant way to solve my problem.
The text was updated successfully, but these errors were encountered: