开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜