Reputation: 167
I have a dropdownmenu which populates from the database. I'm using the following code to do it:-
<%= collection_select(:abc, :SkillSetName, @technologies, :id, :Topic) %>
I have no idea what :abc and :SkillSetName are doing here. I just know that the drop down is being populated with :Topic from my @technologies variable. I want to save the selection made by the user from the drop down menu and send it to the next controller action. I don't want to use f.collection_select
Upvotes: 1
Views: 1799
Reputation: 825
:abc stand for your object and :SkillSetName stand for your method.
when you want to save its value you can get it using params[:abc][:SkillSetName]
Upvotes: 0
Reputation: 43318
If you don't know what :abc
and :SkillSetName
are, how are we supposed to know?
Anyway, the user's selection will be in:
params[:abc][:SkillSetName]
If you want to understand what you are doing, have a look at the API for collection_select
.
Upvotes: 1
Reputation: 1401
See my answer - RoR: collection_select not setting the value in the DB
Upvotes: 0