我是 ruby on rails 的新手,我有一个视图,该视图在该部分文件中有部分文件,我也必须渲染相同的对象,但我收到错误。
这是我的代码
app/view/customer/_form.html.erb
<%= simple_form_for(@customer) do |f| %>
<%= f.input :first_name, placeholder: 'First Name', label: 'Customer First Name' %>
<%= f.input :last_name, placeholder: 'Last name', label: 'Customer Last Name' %>
<%= f.input :email, placeholder: 'user@domain.com', label: 'Customer Email' %>
<%= render :partial=> other_fields,:f => f %>
<%end%>
app/views/customer/_other_fields.html.erb
<%= f.input :user_name, label: 'User Name' %>
<%= f.input :password, label: 'Password' %>
<%= f.input :password_confirmation, :required => true %>
我收到类似的错误
undefined local variable or method `f' for #