【发布时间】:2012-06-11 23:41:17
【问题描述】:
我正在使用 Rails、iOS 和设计。我想阅读单个用户。路径是 users/:id。
我收到以下错误:
Started GET "/users/0" for 127.0.0.1 at 2012-06-11 17:37:50 -0600
Processing by UsersController#show as JSON
Parameters: {"id"=>"0"}
[Devise] Could not find devise mapping for path "/users/0".
Maybe you forgot to wrap your route inside the scope block? For example:
devise_scope :user do
match "/some/route" => "some_devise_controller"
end
Completed 500 Internal Server Error in 0ms
AbstractController::ActionNotFound (Could not find devise mapping for path "/users/0".
Maybe you forgot to wrap your route inside the scope block? For example:
devise_scope :user do
match "/some/route" => "some_devise_controller"
end
我尝试将资源 :users 放在 devise_for :users 下,并获取 "users/:id" => "users#show" 并匹配 "users/:id" => "users#show"。
有什么想法吗?
【问题讨论】:
标签: ruby-on-rails devise crud