Displaying 1 result from an estimated 1 matches for "myhelpernam".
Did you mean:
myhelpername
2006 Aug 16
4
Accessing Constants Declared in Helper Modules
...fortunately, it doesn''t seem to work.
All methods declared in the helper seem to work when called from the
view, but any referenced constants spit out a NameError and Rails tells
me I have an unitialized constant. I can get around this by referencing
the constant explicitly like this: `MyHelperName::CONSTANT`, but this
seems to defeat the elegance of using helpers in the first place.
My current solution is to wrap the constant in a method defined in the
helper file. Is there a way around this? I noticed this ticket
(http://72.14.209.104/search?q=cache:s1V2CcSpQDAJ:dev.rubyonrails.org/tic...