使用标准的Rails form_for,我可以通过select和collection_select助手传递ajax请求,例如:
<%= address.collection_select :country, @countries, :id, :name, {:include_blank => false}, "data-remote" => true, "data-url" => "/ajax/states", "data-type" => :json %>
我似乎无法弄清楚如何使用simple_form
弄清楚了。您只需要添加以下内容:
:input_html => {"data-remote" => true, "data-url" => "/yoururl", "data-type" => :json}