`

restful_authentication 登陆认证系统介绍

阅读更多

      1、关于安装,这里的viki有安装说明:https://github.com/technoweenie/restful-authentication/wiki#INSTALL,关于这个安装,这里有几点要说明:如果你用的是git版本控制系统的话,进入到项目的vender/plugins下,用这个命令进行git clone git://github.com/technoweenie/restful-authentication.git  restful_authentication然后删除这里面的.git文件夹,这样的话,就能够打断于github的版本库的链接,这样才能够允许你用git添加 restful_authentication到你的项目里

      2、利用生成器,

./script/generate authenticated user sessions

  \ --include-activation

  \ --stateful

  \ --rspec

  \ --skip-migration

  \ --skip-routes

  \ --old-passwords

第一个参数 user,指定系统用户注册和登陆用的model,利用migration,将基于这个user创建一个user model和一个user controller。

第二个参数 sessions,指定一个controller(一般都用sessions),这个controller是用来控制用户的登陆登出已经session的存储和销毁的。

--include-activation   生成actionmailer和通过email发送的动态激活码的相关代码,一般用在需要用户登陆邮箱点击带激活码的链接才能激活用户的系统,这个主要是用来防止灌水注册用的。

 

关于其他的详细参数的说明及项目配置,情看上面链接的viki。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics