我试图仅在特定 URL 上强制 SSL(在这种情况下为用户帐户设置),我看到了:Rails 3 SSL Deprecation。这是我原来的路线:
resources :users do
collection do
get :thanks
get :change_password
get :settings
end
end
阅读该答案后,我将其更改为;
resources :users do
scope :constraints => { :protocol => 'https' } do
collection do
get :thanks
get :change_password
get :settings
end
end
end
但是现在让我们说当我尝试进入设置页面时,我收到一个错误,说明The action 'show' could not be found for UsersController
它实际上应该由 User#settings 处理。我究竟做错了什么?