Forum: Ruby on Rails How to access text helper and url helper methods in model

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sunny B. (Guest)
on 2009-01-06 12:39
Hi,

I want to access TextHelper and UrlHelper methods in my model so how i
am able to access it ?

 I was included following helper in my model but still it is not
working? also for accessing these helper method w need to give external
reference?


E.g.
             class Xyz
                include ActionView::Helpers::TextHelper
                include ActionView::Helpers::UrlHelper

Also suggest any other better way of doing it.
Michael L. (Guest)
on 2009-02-20 23:08
Actually, the class has moved:

class Posts < ActiveRecord::Base
  include ActionController::UrlWriter

end


Sunny B. wrote:
> Hi,
>
> I want to access TextHelper and UrlHelper methods in my model so how i
> am able to access it ?
>
>  I was included following helper in my model but still it is not
> working? also for accessing these helper method w need to give external
> reference?
>
>
> E.g.
>              class Xyz
>                 include ActionView::Helpers::TextHelper
>                 include ActionView::Helpers::UrlHelper
>
> Also suggest any other better way of doing it.
This topic is locked and can not be replied to.