I cannot access instance objects in partials. Example:
In the controller, I have:
ActiveAdmin.register Store do sidebar "Aliases", :only => :edit do @aliases = Alias.where("store_id = ?", params[:id]) render :partial => "store_aliases" end end
Then in the _store_aliases.html.erb part, I have:
<% @aliases.each do |alias| %> <li><%= alias.name %></li> <% end %>
This does not work. The only thing that works (which is terrible, since I put the logic into the point of view, is:
<% @aliases = Alias.where("store_id = ?", params[:id]) %> <% @aliases.each do |alias| %> <li><%= alias.name %></li> <% end %>
Hopstream
source share