I want to make chain selects part inside my Formtastic form. But is it possible to set custom ids for multiple selects for future AJAX replacement?
This doesn't work:
<%= semantic_form_for [:admin, @production_year] do |f| %>
<%= f.inputs do %>
<%= f.input :car_model, :label => "CarModel", :as => :select, :collection => Brand.find(:all, :order => "name ASC"), :id => "brand_id" %>
<% end %>
<% end %>
Options should be passed to the input_html hash, like so:
<%= f.input :car_model, :input_html => { :id => "brand_id" } %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With