开发者

routing problem after rails 2.3 to rails 3 upgrade [duplicate]

开发者 https://www.devze.com 2023-04-05 00:07 出处:网络
This question already has answers here: Troubleshooting empty params[] hash since Rails3 Upgrade 开发者_如何学运维 (2 answers)
This question already has answers here: Troubleshooting empty params[] hash since Rails3 Upgrade 开发者_如何学运维 (2 answers) Closed 2 years ago.

In my routes I have:

namespace :pm do
  match '/' => 'base#index', :as => :root
  resources :projects do

Also I have app/controllers/pm/projects_controller.rb

When going in browser to /pm/projects/1, I should have params[:id] == 1, but instead getting empty params hash in action.

In log file:

Started GET "/pm/projects/1" for 127.0.0.1 at Wed Sep 14 15:01:22 +0400 2011
Processing by Pm::ProjectsController#show as HTML

So controller and action are recognised normally

Has anybody seen such thing? Where could be the problem?

Thanks!


It expects a namespaced controller.

resources :projects, :controller => "projects"
0

精彩评论

暂无评论...
验证码 换一张
取 消