ruby on rails - Rails4 -> Change param name for select helper -


i have form being build product model. 1 of form elements select list has qty/price information, form being posted cart model:

<%= form_for @product, url: add_cart_path, method: :post |f| %> ... <%= f.select :prices, price_list %> 

the price_list helper builds option list quantity option value eg:

<option value="25">25 $75.00</option> 

on post receive param values "product"=>{"prices"=>"25"} expected. prefer receive "product"=>{"qty"=>"25"} since it's qty i'm passing , not price. there way rename parameter?

thanks,

leo

for that, need use select_tag:

select_tag "product['qty']", ... 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -