The problem is this: I am showing some data to the user in a table and in it has a field of the numeric type that the user fills. However, I do not know how to send the value populated by the user as a parameter to the controller.
I've tried using the following syntax:
<td><%= number_field :stock, params[:amount] %></td> ## HERE IS THE PROBLEM
<td><%= link_to 'Buy', new_transaction_path(stock: {stock_id: "#{stock[:id]}", buy_price: "#{stock[:value]}", amount: "#{params[:amount]}", transaction_type: 'buy'}), method: :post %></td>
I would like to pass the value that the user informed thought the number_field as a parameter to the controller, but it's not working..