I know this sounds like a really, very simple use case, and I hope it is, but I swear I searched everywhere and did not find any mention in any way - not even the best way - to do it.
I do branding for Ruby, Rails, and everyone else (which can explain a lot). The dummy application that I use as a training tool requires authentication in order to do almost anything meaningful, so I decided to start by solving this problem. I installed the AuthLogic gem and it works well to the extent described in the intro and Railscast documentation, but now I can register, log in and log out ... I need to do something with it.
As an example, I need to create a page where users can upload images. I plan to have an ImagesController with the upload action method, but I want it to be available only to registered users. I believe that in every limited action I could add code to redirect if there is no current_user , but that seems really verbose.
Is there a better way to do this that allows me to identify or identify limited areas and handle authentication in one place?
source share