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 Instructor::FullDashboardController#pupil_leads as JS
and
Rendered instructor/full_dashboard/pupil_leads.js.erb within layouts/main (0.1ms)
But the js has no effect. So to test it I wrote
console.log("Hello");
<%logger.debug "This is the js file"%>
alert('Hello Rails');
In the js.erb file, in my log I see This is the js file
as expected, but there is nothing in js console in my browser and the alert doesn't show. So I know the file is being processed, as my logger.debug works but there is no js.
How can I further troubleshoot this?
Rails 4.1
Ruby 2.1
Full Dash Controller
class Instructor::FullDashboardController < ApplicationController
layout 'main'
...
def pupil_leads
@ivar = Model.where("something = ?", some_object.id).order("created_at desc").page(params[:page]).per(10)
respond_to do |f|
f.js { render :content_type => 'text/javascript' }
f.html
end
end
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…