# How to access text helper and url helper methods in model

**URL:** <https://www.ruby-forum.com/t/how-to-access-text-helper-and-url-helper-methods-in-model/157000>\
**Category:** Rails\
**Created:** [January 6, 2009, 11:39am UTC](https://www.ruby-forum.com/t/how-to-access-text-helper-and-url-helper-methods-in-model/157000 "2009-01-06T11:39:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Post date:** [January 6, 2009, 11:39am UTC](https://www.ruby-forum.com/t/how-to-access-text-helper-and-url-helper-methods-in-model/157000/1 "2009-01-06T11:39:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sunfish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Post date:** [February 20, 2009, 10:08pm UTC](https://www.ruby-forum.com/t/how-to-access-text-helper-and-url-helper-methods-in-model/157000/2 "2009-02-20T22:08:47Z")

</div>

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.
