Hi --
On Sun, 13 Aug 2006, Dave Fox wrote:
> I''ve finally gotten to the point where I want to write my own
helper
> function to call from my views. I used the script/generate to create my
> Controller so I also got the helper file.
>
> I defined the method I wanted to use in the helper rb file, but when I
> try to call them from the view I get a NoMethodError raised.
>
> Is there anything else I have to do besides creating the method in the
> Helper module in the app/helpers directory and call it from a view? The
> on-line documentation on helpers seems a bit light.
Make sure you define the method inside the module definition:
module SomeHelper
def help_me
...
end
end
and not before or after it. I''m just guessing that might be the
problem -- it''s a not unheard-of cause of that NoMethodError from
helpers.
David
--
http://www.rubypowerandlight.com => Ruby/Rails training & consultancy
----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <-----
http://dablog.rubypal.com => D[avid ]A[. ]B[lack''s][ Web]log
http://www.manning.com/black => book, Ruby for Rails
http://www.rubycentral.org => Ruby Central, Inc.