Wyklucz opcję z collection.map w Ruby on Rails?
Mam taką linię:
<%= f.input :state_id, :input_html => {:value => (policy_address.state.name rescue nil)}, :required => true, :collection => states.map {|s| [ s.name, s.id] }, :include_blank => 'Please select'%>
Chcę wykluczyć wartość zstates.map
kolekcja. Myślałem, że to zadziała, ale nie:
<%= f.input :state_id, :input_html => {:value => (policy_address.state.name rescue nil)}, :required => true, :collection => states.map {|s| [ s.name, s.id] unless s.name == "excluded_state" }, :include_blank => 'Please select'%>
Włożyłemunless s.name == "excluded_state
, ale znowu nie działa:
Co ja robię źle?