Ruby on Rails - Getting value from input box and pass to another page
-
12-11-2019 - |
質問
I have to pass the value of an input field to another page where it will add this value to the database.
The code looks like this
.shoping_cart_col2
%input.cart_box{:type => "text", :value => "1"}/
.shoping_cart_col3
= button_to "Add To Cart" , line_items_path(:product_id => @prod)
When i press the "Add to Cart" button i want the value of cart_box to be submitted to the next page with it, this value will be passed to the next page as :quantity
正しい解決策はありません
所属していません StackOverflow