Hi I am trying to set ":selected => nil"
or to a value from a variable like ":selected => val"
in the select() in ruby but it is not working in either ways. Please can anyone tell what is wrong with the given below snippet.
Thanks
<%= select( map1[:field_name], "id", map1[:field_codes], :selected => nil )%>
<%= select( map1[:field_name], "id", map1[:field_codes], :selected => val )%>
where map1[:field_name] is a string
and map1[:field_codes] returns a hash
val is a variable containing one of the values from hash.