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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -