Basically what I'm trying to do (it probably has no sense) is using actions without view, no render and so on. The idea is that I'm gonna have a lot of actions which are gonna perform different stuff and return OK or KO, when OK I'll redirect to my OK page and when KO I'll redirect to KO page.
Of course I can handle these redirects within the action but since all my actions will share the redirects I'd like to handle that in an around filter inside some ApplicationController which inherits from ActionController, something like
around_filter :my_filter
def around_filter
check same stuff for all the actions
return = yield
if return == ok
redirect_to ok_page
else
redirect to ko_page
end
end
But of course I'm getting double render error or missing template error because I can't keep an action without any view. So the question... is there any way to do that? Handle all the redirects in just one place?