I have a very big function in my model and I want to store it somewhere else in order to keep my model dry. I read that storing methods in ApplicationHelper and then calling them from a model is a bad idea. What is a good idea then?
I want to have a separate file with my big methods and call them from a model.
I have a very big function in my model and I want to store
Share
Use a Concern. https://gist.github.com/1014971
It’s simple. In
app/models/concernscreate a fileyour_functionality.rbas follows:And in your model simply: