2011-11-28 28 views
0

我在Active Admin的dashboards.rb文件中創建了此部分。我需要將變量傳遞給partial,以便它可以在/ Admin的儀表板部分上顯示該數據。我需要在控制器中創建方程,或者在部分可以獲得的地方創建方程,並將它們傳遞給部分。我可以在活動管理員那裏做到這一點?將控制器邏輯(如「@answers = Answer.all」)傳遞給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 

回答