Passing controller logic, like “@answers = Answer.all”, to Active Admin partial
-
22-10-2019 - |
문제
I created this partial in the dashboards.rb file for Active Admin. I need to pass variables to the partial so it can render that data out on the dashboard section of /Admin. I need to create the equations in a controller, or somewhere where the partial can get at it, and pass them to the partial. Where can I do that in active admin?
# == Render Partial Section
# The block is rendered within the context of the view, so you can
# easily render a partial rather than build content in ruby.
#
section "Month One Statistics" do
div do
render 'recent_graphs' # => this will render /app/views/admin/dashboard/_recent_posts.html.erb
end
end
해결책
Try the wiki, it has a good explanation, as well as other goodies here:
제휴하지 않습니다 StackOverflow