# Using text helper in a model class

**URL:** <https://www.ruby-forum.com/t/using-text-helper-in-a-model-class/152035>\
**Category:** Rails\
**Created:** [October 29, 2008, 11:34am UTC](https://www.ruby-forum.com/t/using-text-helper-in-a-model-class/152035 "2008-10-29T11:34:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanight](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@vanight](https://www.ruby-forum.com/u/vanight)\
**Post date:** [October 29, 2008, 11:34am UTC](https://www.ruby-forum.com/t/using-text-helper-in-a-model-class/152035/1 "2008-10-29T11:34:10Z")

</div>

Hi,

I have refactored my code and the previous function in my controller  
help.truncate() doesn’t seems to work anymore in my model.

My model class is generating files and I’d like to use this text helper.  
How can I fix that?

Thanks

---

<div class="post-metadata">

**Author:** ![vanight](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@vanight](https://www.ruby-forum.com/u/vanight)\
**Post date:** [October 29, 2008, 2:58pm UTC](https://www.ruby-forum.com/t/using-text-helper-in-a-model-class/152035/2 "2008-10-29T14:58:49Z")

</div>

If you want to use rails text helpers in your model then include the  
text helper module in the model like so

include ActionView::Helpers::TextHelper

On Oct 29, 10:34 am, David N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
