在控制器中使用这个方法,能够控制访问操做的对象,以及操做的方法http_basic_authenticate_with,例如:code
http_basic_authenticate_with name: "dhh", password: "secret", except: [:index, :show]对象
http_basic_authenticate_with name:
"dhh"
, password:
"secret"
, except: [
:index
,
:show
]