[Rails] Using Helper Classes for standard processing
Eric Anderson
eric at afaik.us
Wed Jan 12 20:54:27 GMT 2005
Most of the time the helper classes are geared towards generating
boilerplate (or almost boilerplate) code for output. I am wanting to use
a helper for boilerplate or almost boilerplate processing instead.
I have a certain process that needs to happen for several controllers.
Instead of just copying the action to all the controllers I figured I
would put the action in a Helper module and then simply use the helper
class method to mixin that action to my controller.
When I tried to do this I get a message about the controller not being
able to respond to the requested action. To get around this I manually
required the helper file and manually mixed it into my controller module
and that worked great.
My question is why didn't simply using the helper class method work? The
code looks seems to just require the file and do an include in a
class_eval. Basically it is doing the same thing I did manually. So why
doesn't this work?
The bug is not that big of a deal, but if I can simply my code I would
like to. Anybody have any ideas?
Eric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://one.textdrive.com/pipermail/rails/attachments/20050112/dd0b96be/signature.bin
More information about the Rails
mailing list