How to add default value to a text field in rails? -
i've created form
<%= form_for [current_user,@product,@bid] |f| %> <p><%= f.number_field :bid_amount %></p> <p><%= f.number_field :product_id %> <p><%= f.submit 'bid!' %></p> <% end %>
in :product_id field want add @product.id default, how implement this? please. in advance. :)
<p><%= f.number_field :product_id, :value => @product.id %></p>
more details on: numberfield
Comments
Post a Comment