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

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

    Does your app/assets/javascripts/application.js contain

    //= require jquery
    //= require jquery_ujs 
    

    ?

    And your erb contains <%= javascript_include_tag "application" %>?

    I was just struggling with a problem like this for HOURS and the last of those two points fixed it; I saw the first point mentioned in some other questions so I'll repeat it here.

    Hope that helps.

    (Credit where credit's due)

提交回复
热议问题