I have a form in my View with two dropdowns, both populated from db tables, where I\'d like to auto-submit the form when onchange event occurs on either dropdown:
See documentation: http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-select
The arguments goes like this:
select(object, method, choices, options = {}, html_options = {})
:onchange
belongs to html options thus you need to fix your select box to this:
select('post', 'state', @suppliers.collect {|s| [s.supp_state, s.id]}, :onchange => "this.form.submit()")