在我的 routes.rb 文件中,我定义了这些路由:
map.with_options(:controller => "review") do |review|
review.review_index "/review/:page", :action => "index", :defaults => {:page => nil}, :requirements => {:page => /[0-9]./}
review.review_provider "/review/:category_name/:page", :action => "provider", :defaults => {:page => nil}
end
但是,它仅与第二条路线匹配。例如,
/review/1
必须与第一条规则匹配,但实际上它与第二条规则匹配。
我该如何配置它以便:
/review/1 will match with the first rule
/review/a_category/1 will match with the second rule