How to access text helper and url helper methods in model


#1

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.


#2

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.