Skip to content

How to add instance variable for the Dashboard

tiwatson edited this page Jul 14, 2011 · 2 revisions

Active Admin does not support this functionality. The instance variables are not set in any children contexts due to the manner in which the views are constructed as classes. The variables should be passed in to the render call as local variables:

 section "Stats" do
   @accounts_count = Account.count
   div do
     render 'stats', { :accounts_count => @accounts_count }
   end
 end