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
Post a Comment