I would like to pass the form_for object to a partial:
form_for
<%= form_for @price do |f| %> ... <%= render :partial => "price_page", :object => @price, :as => :f %> ... <% end %>
When I call:
f.radio_button
Brings the error:
undefined method `radio_button' for #<Price:0x3cb1ed0>
How can I use f as I usually would in this partial?
f
Try passing form object as local <%= render :partial => "price_page", :locals=>{:f=>f} %>
<%= render :partial => "price_page", :locals=>{:f=>f} %>
1.4m articles
1.4m replys
5 comments
57.0k users