<%= collection_select(:state, liststates, @states, :id, :name, ‘class’
=> ‘drops’ ) %>
Trying to style the select box using the class - drops. Doesn’t seem
to be working, is there something wrong ?
TIA
Stuart
<%= collection_select(:state, liststates, @states, :id, :name, ‘class’
=> ‘drops’ ) %>
Trying to style the select box using the class - drops. Doesn’t seem
to be working, is there something wrong ?
TIA
Stuart
Trying to style the select box using the class - drops. Doesn’t seem
to be working, is there something wrong ?
From the API docs:
collection_select(object, method, collection, value_method, text_method,
options = {}, html_options = {})
class is an HTML option, so try:
<%= collection_select(:state, liststates, @states, :id, :name, nil,
{:class => ‘drops’} ) %>
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs