Hi all,
I'd like to run a rake task in my controller. Is there any way to do this?
Thanks,
Sophy,
Hi all,
I'd like to run a rake task in my controller. Is there any way to do this?
Thanks,
Sophy,
I don't find it good style to call a rake task in code. I recommend putting the code for the task that you want to execute somewhere outside a rake task, and have the rake task call this code.
This not only has the advantage of being easy to call outside rake (which is what you want), but it also makes it much easier to test the rake task.