ruby on rails - How to use auto_link inside of a controller -
in controller need build json object. how can use auto_link() inside controller? right errors:
nomethoderror (undefined method `mail_to' #<conversationscontroller:0x144c3f880>): app/helpers/application_helper.rb:48:in `html_format' app/controllers/conversations_controller.rb:326:in `comments' app/controllers/conversations_controller.rb:322:in `comments'
thank ideas
auto_link
helper , can reference if view. , there's reason that: representing information view responsibility.
in case, either create json template or, if really need use helper in controller, include actionview::helpers::texthelper
module in controller.
class conversationcontroller < applicationcontroller include actionview::helpers::texthelper include actionview::helpers::urlhelper end
you might need include al dependencies, such module contains mail_to
helpers.
Comments
Post a Comment