0

I'm trying to monkey patch a gem's view helper method without success. It's being ignored and the original gem code runs. Where should I put the file to have it run?

I created the file lib/kaminari.rb containing (lib/ is in load path):

module Kaminari
  module Helpers

    class Tag

      def page_url_for(page)
        if @params[:controller] =~ /fc_rseries/
          My::Engine.routes.url_helpers.url_for @params.merge(@param_name => (page <= 1 ? nil : page), :only_path=>true).symbolize_keys
        else
          @template.url_for @params.merge(@param_name => (page <= 1 ? nil : page))
        end
      end

    end

  end
end
Holger Just
  • 52,918
  • 14
  • 115
  • 123
rigyt
  • 2,219
  • 3
  • 28
  • 40

1 Answers1

0

I added the file in app/helpers

rigyt
  • 2,219
  • 3
  • 28
  • 40