# Has anybody stored two same methods in a controller class?

**URL:** <https://www.ruby-forum.com/t/has-anybody-stored-two-same-methods-in-a-controller-class/89215>\
**Category:** Rails\
**Created:** [March 18, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/has-anybody-stored-two-same-methods-in-a-controller-class/89215 "2007-03-18T19:45:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrkiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c68b51/32.png) [@mrkiss](https://www.ruby-forum.com/u/mrkiss)\
**Post date:** [March 18, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/has-anybody-stored-two-same-methods-in-a-controller-class/89215/1 "2007-03-18T19:45:03Z")

</div>

I did.

But it works without error

Lower method works and upper method idle. Name of two methods are same  
^^

is this a bug?

---

<div class="post-metadata">

**Author:** ![mrkiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c68b51/32.png) [@mrkiss](https://www.ruby-forum.com/u/mrkiss)\
**Post date:** [March 18, 2007, 7:54pm UTC](https://www.ruby-forum.com/t/has-anybody-stored-two-same-methods-in-a-controller-class/89215/2 "2007-03-18T19:54:05Z")

</div>

That’s because Ruby allows you to redefine methods on the fly, so that  
second definition is viewed as just that. A redefinition. The first is  
nullified effectively.

RSL
