Topic: Design Approach Redux

Ok, so I've gotten my models and controllers done, my css is for the most part finished, and I delayed worrying about roles and rights until the end. Well, it's the end now, and I need to start implementing this authorization and access. Once again, I'm not sure where to put stuff.

Right now, I have all password functionality in the user controller and model. It has made the controller very unRESTful, as you might expect. How should I code the "welcome" part? What I mean is, should I pull the login functionality from my users model and put it elsewhere?

What I'm looking at is a welcome screen that has the username password partial. If the user is logged in, that gets replaced by a navigation menu. The site can't be accessed (except the welcome screen) by non logged in users.

Should I build some kind of welcome controller? How about all of the password functionality (lost password, change password)?

Any ideas would be greatly appreciated.

Re: Design Approach Redux

I am far from a rails expert but I would create a login controller. Agile Web Development with Rails does it this way and it has worked great for me.

"They say, Evil prevails when good men do nothing. What they should have said was: Evil Prevails."

Re: Design Approach Redux

You may want to use the restful authentication plugin. If nothing else, this will show you how to create a restful SessionsController.

As for the welcome page, it's hard to say where it should go without know exactly what it does. It may belong in its own non-RESTful controller.

Railscasts - Free Ruby on Rails Screencasts