Rails 3 routes problem

I’m trying to port Rails 2 application to Rails 3 and I’ve problem
with routes. Here is my routes.rb

Enki::Application.routes.draw do
match ‘/admin/health/:action’ => ‘admin/health#index’, :as
=> :admin_health
match ‘/admin’ => ‘admin/dashboard#show’
match ‘/admin/api’ => ‘admin/api#index’
match ‘/archives/:year/:month’ => ‘archives#view’#, :as => :archives
match ‘/archives’ => ‘archives#index’, :as => :archives
root :to => ‘posts#index’
resources :posts
resources :pages

Problem is that empty params hast is passed to the archives_controller
when I try to load localhost:3000/archives/2010/02. On the other hand
if I comment out last route (resources :pages) correct parameters are
passed. After poking around the code for a few hours I ran out of
ideas. Obviously I’m missing something but I cannot figure what.

I would appreciate a lot if anyone can tell me what is the reason of
this strange behavior and why parameters hash is empty with above
routes.rb file and they are correct {:year => ‘2010’, :month => '02}
if last line is commented out?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs