[英] Render partial :collection => @array specify variable name
我正在渲染一个类似这样的部分:
$("#box_container").html("<%= escape_javascript( render :partial => 'contacts/contact_tile', :collection => @contacts) %>")
问题是我的partial需要变量"contact".
ActionView::Template::Error (undefined local variable or method `contact'
我只想告诉偏微分方程,期望变量为contact
.应该将@contacts
循环为contact
.我该怎么做?