Is there a way to submit ajax/json requests with simple_form for Rails

后端 未结 5 1949
感情败类
感情败类 2021-01-05 09:43

With the standard Rails form_for, I was able to pass ajax requests though select and collection_select helpers as such:

<%= address.collection_select :cou         


        
5条回答
  •  温柔的废话
    2021-01-05 10:37

    Figured it out. You just need to add the this:

    :input_html => {"data-remote" => true, "data-url" => "/yoururl", "data-type" => :json}
    

提交回复
热议问题