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

前端 未结 4 1012
自闭症患者
自闭症患者 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:38

    My solution was to replace

    format.json do
    

    with

    format.js do
    

    you can troubleshoot the request by setting a breakpoint (i use pry) in the controller and then look at the variable

    request.format
    

提交回复
热议问题