Sunday, May 23, 2010

[Rails] Re: Extending a module in a controller

Frederick Cheung wrote:
> On May 23, 12:59�am, Marnen Laibow-Koser <li...@ruby-forum.com> wrote:
> ... by putting it inside the controller like that you've
> created a new module called LookupController::Enumerable rather than
> extending Enumerable. If I were you I'd keep extensions to core
> classes somewhere in lib.
>
> Fred

Ah I see, of course. So I've moved it to 'my_extensions.rb' in lib/,
added "require 'my_extensions'" in the controller and now it works fine.
Thanks!
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate