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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -