ActiveAdmin.register_page 'capture_payments' do
content do
@payments=Payments.all
render :partial => 'authorised_payments', locals: {aliases: @payments}
end
end
我的部分内容并未收到@payments
。如果我尝试locals[:aliases]
>> locals[:aliases]
NameError: undefined local variable or method `locals' for #<#
答案 0 :(得分:2)
将locals: { aliases: @payments }
传递给render
,您可以访问部分内的本地变量aliases
,例如:
<%= form_for(aliases) do |f| %>
# some code
<% end %>