Rails: Accessing /lib Modules from Controller
- by Dex
I have a Module called /lib/string_parser.rb. It looks like:
module StringParser
def wrap_lines(input, chars)
...
end
#make available to views
def self.included(base)
base.send :helper_method, :my_method_for_views if base.respond_to? :helper_method
end
end
I'm trying to call wrap_lines from the create method of my controller but no matter what I do, I keep getting NoMethodErrors for an undefined method.