nesquena / rabl

General ruby templating with json, bson, xml, plist and msgpack support
http://blog.codepath.com/2011/06/27/building-a-platform-api-on-rails/
MIT License
3.64k stars 334 forks source link

Undefined method when trying to use custom helper methods #682

Closed scottrobertson closed 3 years ago

scottrobertson commented 8 years ago

Hey

I am using rabl (via rabl-rails), with Rails 4.2.7.1 (and rails-api). I have the following:

module PaginationHelper
  def pagination
    {}
  end
end

and I am calling pagination from within rabl, and I am getting the following.

undefined local variable or method 'pagination' for #
<Rabl::Engine:0x007fbdc8735c20>

I have tried adding helper :pagination to my ApplicationController.

I have also tried looking at other issues, but they all seem to be from years ago, and are marked as resolved.

scottrobertson commented 8 years ago

Also tried adding the method directly to the controller using helper_method but that doesnt work either.