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

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.
Martin S. (Guest)
on 2005-12-22 13:53
(Received via mailing list)
Hi,
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.
removed_email_address@domain.invalid
Tel: 0 36 43 - 41 41 56
http://www.uni-weimar.de/~scheffl2
icq: 137729435
This topic is locked and can not be replied to.