views:

20

answers:

1

I know that I can use the db schema to easily generate CRUD for me. But I want to do a simple login page, it only using the "user" object, check whether the password & user name is correct. So, I want to create an "system" object which have a "login" method. How can I do that in RoR?

+1  A: 

You can create a Controller and views without model and that will work. It looks like you want a super simple login which is described in this railscast. To see how to restrict access to pages, see the previous railscast

Chandra Patni
Um... ..How can I do restriction on my application? I do restriction in the models before. But my system only have the controllers and view, where can I add the restrictions?
Ted Wong
You can do restrictions on controller by via `before_filter`.
Chandra Patni
I have updated the answer on how to add restrictions to other controllers.
Chandra Patni