I have a method which runs several rake commands.
Does this method belong in the controller or in the model?
My intention is to run this method upon every Save or Update
I have a method which runs several rake commands.
Does this method belong in the controller or in the model?
My intention is to run this method upon every Save or Update
This belongs in the models, write an Observer
that will observe the appropriate model, and put this action there...
http://api.rubyonrails.org/classes/ActiveRecord/Observer.html
You can use a before_save or after_save filter in the model to call arbitrary code, which could include a rake task I guess (I wouldn't do anything too heavyweight though since it could harm the responsiveness of your application).