I've created a form
<%= form_for [current_user,@product,@bid] do |f| %> <p><%= f.number_field :bid_amount %></p> <p><%= f.number_field :product_id %> <p><%= f.submit 'Bid!' %></p> <% end %>
In the :product_id field I want add @product.id by default, how to implement this?
<p><%= f.number_field :product_id, :value => @product.id %></p>
more details on: NumberField
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With