开发者

Help with rails restful authentication

I just installed the restful authen开发者_开发知识库tication using this plugin and when I go to localhost:3000/login i get this error

NameError in SessionController#new

uninitialized constant SessionController

Any ideas? please help.


First of all, if you're just getting started with Rails authentication, I'd highly recommend you use Authlogic. Restful Authentication had its time but it generates a lot of code that isn't always clear and it's pretty tough to extend.

If you're set on using Restful Auth, make sure your Session controller is created, the routes are present, and the actions within the session_controller.rb are created.


This was mentioned on the Railscasts site...

Try this (pluralize sessions):

map.resource :session, :controller => 'sessions'


Restful auth had its day. You'll be better off with authlogic. I wrote a little post here on authlogic basics.

http://blog.platform45.com/2009/09/30/user-authentication-with-authlogic

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜