Lets use a real world example.
I want to monkey patch WillPaginate::LinkRenderer.to_html method.
So far I have tried:
- Created a file in folder: lib/monkeys/will_paginate_nohtml.rb
- Added in config/environments.rb: require 'monkeys/will_paginate_nohtml' at the end of the file
- Inside that file, this was my code:
e
module Monkeys::WillPaginateNohtml
def to_html
debugger
super
end
end
WillPaginate::LinkRenderer.send(:include, Monkeys::WillPaginateNohtml)
But somehow, debugger doesn't get passed through. Looks like the patching failed.
Any help would be appreciated, thanks!