Extending login engine

I would like to add a few variables to an existing “login” method in
the login engine. Is there an easy way to do that with out overriding
the whole method? I also don’t want to copy the whole method in my
class.

Thanks,

Without know more about what you want to do, the answer is probably
not… if you want to add parameters to a method, you’ll have to
redefine it.

  • james

Thanks. I was looking into super. I thought I could call that, but
my user_controller is not a child of the login engine’s. Oh well.

Jay

FYI: I use the alias_method which seems to work well.

alias_method :orig_login, :login

Then I can do my stuff and call orig_login from the login_engine.

-Jay

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs