Get the selected option's text field in controller in Ruby -


I know how to get the value of the selected option in the dropdown in the controller.

My question is to select this type

  & Lt; Select name = "category_id" & gt; & Lt; Option value = "0" & ​​gt; New & lt; / Options & gt; & Lt; Option value = "1" & gt; Sub-category 1 & lt; / Options & gt; & Lt; Option value = "2" & gt; Sub-category 2 & lt; / Options & gt; & Lt; Option value = "3" & gt; Sub-category 3 & lt; / Options & gt; & Lt; / Select & gt;  

How can I get the selected text even after the admin is posted after the request? So if the user selects option 1, then I also need "0" and "new". @ Shirya @ shirya, not sure why you want to value the text from a form post. Do you want to class = class? Can you see the values ​​in ['Categories'] config?


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -