ruby on rails 3 - Is is possible to render a normal template html.erb template with active admin? -
i have custom page in admin built active admin:
in app/admin/stats.rb:
activeadmin.register_page 'stats' controller def index @foo = 'bar' end end end and in app/views/admin/stats/index.html.erb:
<h1> admin stats</h1> <p><%= @foo %></p> when go /admin/stats, see page, without normal admin layout (like on dashboard page)
how can decorate page default layout ?
i've tried:
activeadmin.register_page 'stats' content 'foobar' end controller def index @foo = 'bar' end end end but doesn't change anything. still stat page no layout. ideas ?
this 1 way it:
in app/admin/stats.rb:
activeadmin.register_page 'stats' content render 'index' end controller def index @foo = 'bar' end end end and rename app/views/admin/stats/index.html.erb app/views/admin/stats/_index.html.erb (notice _)
and works fine.
from understand, if index.html.erb present in views/admin/stats, content block not called. if index.html.erb renamed else, go content block, layout rendering called...
Comments
Post a Comment