# Using a helper method in a model

**URL:** <https://www.ruby-forum.com/t/using-a-helper-method-in-a-model/114346>\
**Category:** Rails\
**Created:** [September 11, 2007, 4:53pm UTC](https://www.ruby-forum.com/t/using-a-helper-method-in-a-model/114346 "2007-09-11T16:53:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iain\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/6bbea6/32.png) [@Iain\_A](https://www.ruby-forum.com/u/Iain_A)\
**Post date:** [September 11, 2007, 4:53pm UTC](https://www.ruby-forum.com/t/using-a-helper-method-in-a-model/114346/1 "2007-09-11T16:53:56Z")

</div>

I know this is officially a bad design but I need to use the link\_to  
method in a model and cannot seem to call the method correctly, can  
anyone point me in the right direction?

---

<div class="post-metadata">

**Author:** ![Iain\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/6bbea6/32.png) [@Iain\_A](https://www.ruby-forum.com/u/Iain_A)\
**Post date:** [September 11, 2007, 5:42pm UTC](https://www.ruby-forum.com/t/using-a-helper-method-in-a-model/114346/2 "2007-09-11T17:42:55Z")

</div>

Iain A. wrote:

> I know this is officially a bad design but I need to use the link\_to  
> method in a model and cannot seem to call the method correctly, can  
> anyone point me in the right direction?

link\_to is a method in the ActionView::Helpers::UrlHelper module.

But I have a feeling whatever you’re trying to achieve you’re probably  
going the wrong way about it. link\_to is a view helper. I can’t see any  
reason to call it from a model method.
