Since ‘HTML’ do not have the attribute ‘name’,I am looking for a way to accept the value, which I populated in views, in the controller and assign it a variable name for another use.
This is sample of my code:`
enter code here<form action="<%=url_for(:action =>:make_comment) %>">
<fieldset>
<select>
<%@category.each {|x|%>
<option id="label"> <%=x%></option>
<%}%>
</select>
</fieldset>
<input type="submit" value="submit"/>
</form>`
Are you saying that your html doesn’t have a
nameattribute? If so, why?The name attribute is what the server will interpret as the “key” for the value that you are sending. I don’t know what other way you could try to go about doing this.
Maybe if you paste some code from your controller and your view, I could give a better answer.
Edit: After seeing your edited question, what you want to do is have your
selecttag with thenameattribute, and youroptiontags have avalueattribute with the value you want to send.Hope this helps.