[Rails] Re: Extending a module in a controller

2010-05-23 Thread Toby Rodwell
Frederick Cheung wrote: > On May 23, 12:59�am, Marnen Laibow-Koser 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.

[Rails] Re: Extending a module in a controller

2010-05-23 Thread Frederick Cheung
On May 23, 12:59 am, Marnen Laibow-Koser wrote: > > module Enumerable > >   def my_compress > >     > > > ... but when I visit the web page in question I get "No method > > 'my_compress' for Array ..." > > > I'm probably doing something fundamentally wrong - what could/should I > > be doing

[Rails] Re: Extending a module in a controller

2010-05-22 Thread Marnen Laibow-Koser
Toby Rodwell wrote: > I'm trying to extend Enumerable in my Rails app. I've started with just > the controller where I wanted to use this method i.e. > > class LookupController < ApplicationController > > module Enumerable > def my_compress > > > ... but when I visit the web page in q