Forum: Ruby on Rails use helper methods in controller? (sanitize)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Martin S. (Guest)
on 2005-12-22 13:53
(Received via mailing list)
I want to use the method sanitize() to clean up some user input before I
save it to the db. sanitize() is a helper method, so it is only usable
in templates, right?
So how can I use helper methods in the controller, or why should I not?
I could build a template like "<%=sanitize(input)-%>" and use
render_to_string, but that seems pretty hackish.
Or I could sanitize every time I output the data in a template, but that
seems like a waste of processing power.

Martin S.
Tel: 0 36 43 - 41 41 56
icq: 137729435
This topic is locked and can not be replied to.