I'm trying to use a collection_select on a form, I want them to be able to choose from objects in a different table, and then whatever they choose to become part of the parameters in the new entry (Loan.new (lender_id: params[])). It might just be where I got the form from, but I'm not sure how to pull the selection from the form into the controller.
Example code:
<%= collection_select(:post, :id, User.order('username'), :id, :username) %>
I'm trying to use a collection_select on a form, I want them to be able to choose from objects in a different table, and then whatever they choose to become part of the parameters in the new entry (Loan.new (lender_id: params[])). It might just be where I got the form from, but I'm not sure how to pull the selection from the form into the controller.
Example code:
<%= collection_select(:post, :id, User.order('username'), :id, :username) %>