Ask A Question

Notifications

You’re not receiving notifications from this thread.

NameError (undefined local variable or method `fetch_records' for ....

Victor Nizeyimana asked in Databases

Hi,

I'm getting this wierd error.

NameError (undefined local variable or method `fetch_records' for #<CommentsDatatable:0x00007f7fae91f8b8>):
app/controllers/admin_controller.rb:69:in `block (2 levels) in comments'
app/controllers/admin_controller.rb:67:in `comments'

Code:

  def comments
    respond_to do |format|
      format.html
      format.json { render json: CommentsDatatable.new(view_context) }
    end
  end
Reply

Hey Victor,

Are you sure fetch_records isn't a method you're supposed to define in your class? From the examples for the datatables gem, it looks like you typically write that method yourself in the class.

Reply

Can you post your CommentsDatabale class for us as well?

Reply

Hey Chris,

I found the solution. https://github.com/jbox-web/ajax-datatables-rails/blob/master/doc/migrate.md
I used the old methods...

Thanks for your help! and support!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,038+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.