how do I add a dynamic redirect? I tried it in ApplicationController
and ApplicationHelper
with no success.
I want something like this:
def dynamic_path
if current_user.admin?
admin_path
else
overview_path
end
end
What's the best practice for that?
Thanks!
Edit:
Oh, I forgot to mention that I want to put this into my gem which is used by two different applications and both should use this method. Where exactly should I put it?