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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -