I am trying to decorate a controller from another rail engine. I have one controller method that I want to extend with just one more line. I prefer not to duplicate the entire original controller method.
This is what I tried:
Backend::BaseContentsController.class_eval do
def booking_update
update
end
alias_method :update, :booking_update
end
Unfortunately, this throws an exception stack level too deep. Usually with inheritance, I could just call super. What would be ideal in my case?
source
share