Super Simple Authentication

The final piece of the administration puzzle: authentication. There are many different approaches which is why I saved this step for last. This episode will cover a few techniques including the simple solution used for this site.
 
在管理系列的最后一部分是关于权限认证的内容。权限认证有很多不同的方式。这节涵盖了其中一部分技巧,包括railscasts网站所用的简单的方案。
 
1.插件方式。restful_authentication
2.对于 admin?方法
def admin?
   current_user.admin?  #自己编写
end
 
 
另外还有
def admin?
    request.remote_ip==127.0.0.1
end
 
或者可以创建一个login页面
在sessionsController中