# Extending login engine

**URL:** <https://www.ruby-forum.com/t/extending-login-engine/63638>\
**Category:** Engines Development\
**Created:** [June 16, 2006, 8:59pm UTC](https://www.ruby-forum.com/t/extending-login-engine/63638 "2006-06-16T20:59:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay\_Powers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@Jay\_Powers](https://www.ruby-forum.com/u/Jay_Powers)\
**Post date:** [June 16, 2006, 8:59pm UTC](https://www.ruby-forum.com/t/extending-login-engine/63638/1 "2006-06-16T20:59:52Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![Jay\_Powers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@Jay\_Powers](https://www.ruby-forum.com/u/Jay_Powers)\
**Post date:** [June 18, 2006, 4:28pm UTC](https://www.ruby-forum.com/t/extending-login-engine/63638/2 "2006-06-18T16:28:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jay\_Powers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@Jay\_Powers](https://www.ruby-forum.com/u/Jay_Powers)\
**Post date:** [June 19, 2006, 7:22pm UTC](https://www.ruby-forum.com/t/extending-login-engine/63638/3 "2006-06-19T19:22:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jay\_Powers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@Jay\_Powers](https://www.ruby-forum.com/u/Jay_Powers)\
**Post date:** [June 19, 2006, 10:29pm UTC](https://www.ruby-forum.com/t/extending-login-engine/63638/4 "2006-06-19T22:29:32Z")

</div>

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
