I want to create a custom filter for auto_html. Where do I put the filter so I can use it?
The documentation doesn’t touch on any of that. Thanks!
I want to create a custom filter for auto_html. Where do I put the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The approach I took was to add the code to an initializer file such as:
/path/to/your/application/config/initializers/auto_html.rb
Then you can just write something like:
And call
auto_html(input) { change_colours }in your model. The empty hash will take any options you care to pass to the filter.