Rails 3 - is possible to run an action after ending the first?
I am interesting about an option to run an action in a moment, when is ending the currently action.
More specifically, I want to run an action for download files from my page and after downloading a开发者_如何学运维ll files this action is ending (usually behavior - this action is running by CRON).
And now I would like to automatically run the second action. This action will be checking the downloaded files...
Exist any way, how to do? Thank you a lot,
M.
You cannot render multiple times in one request. HTTP requests can only have one response, so if you did, you would end up with the output concatenated, which would probably not be useful.
If you have controller logic from another action that you want to invoke (which does not include rendering), you can do this by simply calling the other action method, or by factoring the logic you need into a separate method on the controller. If you were trying to share logic among separate controllers, you would need to move this method to your ApplicationController
.
精彩评论