在控制器中使用這個方法,能夠控制訪問操做的對象,以及操做的方法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
]