js.erb not executing javascript but is processed rails

后端 未结 1 1392
陌清茗
陌清茗 2021-01-13 03:26

I\'m trying to get my pagination working with Ajax, using either will_paginate or kaminari.

When I hit pagination link my log says

Processing by Ins         


        
相关标签:
1条回答
  • 2021-01-13 04:02

    Add layout: false option to the render block:

    def pupil_leads
       # some code here
      respond_to do |f|
        f.js { render layout: false, content_type: 'text/javascript' }
        f.html
      end
    end
    

    For some reason Rails don't recognize request as xhr, I also watched that the views extension (.erb.html or .slim) must be specified in full.

    0 讨论(0)
提交回复
热议问题