开发者

Routes in Rails 3

开发者 https://www.devze.com 2023-04-07 11:24 出处:网络
I\'m new to Rails 3 and I need some help regarding the routes. This is my old route map.connect \'/admin/login/:language/:brand\',

I'm new to Rails 3 and I need some help regarding the routes.

This is my old route

map.connect '/admin/login/:language/:brand',
 :controller => 'adm/auth', :action => 'login',
 :defaults => {:brand => 'brand', :language => 'en'}

as I change it to

match '/admin/login/:language/:brand', :to => 'adm/auth#login' ,
:defaults => {:brand => 'brand', :language => 'en'}

and also

map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'

to

  match "/:controller(/:action(/:id))"
  match "/:controller(/:action(/:id))(.:format)"

but still I'm getting No route matches [GET] "/cmm" ,error.

I'm using Jruby 1.6.4 and rails 3.开发者_如何学C1.1

Somebody please help me!


Could you post the complete url you are trying to access (maybe redact the domain, if that's a secret).

Basically I'm interested in if /cmm is in the start of the url, therein lies your problem. As I read you routes, you have nothing matching example.com/cmm/...

0

精彩评论

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

关注公众号