Rails link_to with remote: true processing html instead of js after page refresh

前端 未结 4 1018
自闭症患者
自闭症患者 2021-02-04 07:40

I have a search page in my app, where there is an ajax search form. The search form works properly, passing parameters to the model to filter the search, and the model returning

4条回答
  •  灰色年华
    2021-02-04 08:29

    What solver it for me was adding :format => "js"

    So in your case:

    <%=link_to "Message", message_user_path(:id => user.id, :format => "js"), :remote => true %>
    

提交回复
热议问题