# products_controller.rb
before_filter :authenticate

protected

def authenticate
  authenticate_or_request_with_http_basic do |username, password|
    username == "foo" && password == "bar"
  end
end
评论
flyingzl 2008-03-03   回复
呵呵 自己测试了 就有意思咯
cnforum 2008-01-04   回复
无聊的文章,自说自话。
mmiwwcom 2007-12-22   回复
hideto
请问那条高速公路路边没有一些标识牌的??
wrb302 2007-12-08   回复
hideto还是稍微加一两句说明吧
方便初学者
自己日后看也方便呀
cmo 2007-12-06   回复
这段代码说表达什么意思HTTP Basic Authentication ,只是更简洁还是有更好的性能?
freesky1002 2007-12-06   回复
这样的文章有意思吗?
发表评论

您还没有登录,请登录后发表评论

hideto
搜索本博客
我的相册
A6bdc31c-c66e-468e-961e-9cc721e82adc-thumb
screenshot
共 1 张
存档
最新评论