Forum: Ruby on Rails using text helper in a model class

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.
36a866aad2bd74afb2dd1396104418a3?d=identicon&s=25 David Nguyen (pppswing)
on 2008-10-29 11:34
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
Dd9ab512706dd6cb1de818a658566ba2?d=identicon&s=25 nas (Guest)
on 2008-10-29 14:58
(Received via mailing list)
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 Nguyen <rails-mailing-l...@andreas-s.net>
This topic is locked and can not be replied to.