I made a helper module and put it in the helper directory but when I
try and access any methods it says it does not recognize them. Ideas?
Rails 2.3.5
Helper:
module XmlTestDataHelper
def update_xml_data
end
end
Controller:
update_xml_data
undefined local variable or method `update_xml_data’
On Sat, Apr 17, 2010 at 2:19 PM, Me [email protected] wrote:
end
Controller:
update_xml_data
undefined local variable or method `update_xml_data’
Are you requiring the file and including the module somewhere?
–
Leonardo M…
There’s no place like ~
No, are not all of the helpers included all the time? I have
‘helper :all’ in the application controller.
helper: all just makes all the helpers available to your views, but
not to controller or model classes. This is because helpers are really
meant for views only. You can mix a helper in by including the helper,
but it really isn’t a good practice. Better to create a separate
module or mixin and not have it be a helper.
Sheldon Finlay