RoR中的jQuery验证(jQuery Validation in RoR)
map.check_email "users/check_email", :controller => "users", :action => "check_email"
map.resources :users
在教程中,它告诉我将这添加到我的routes.rb中,但是我得到错误
undefined local variable or method `map' for #<ActionDispatch::Routing::Mapper:0x5f8f308>我正在使用rails 3.0.9,我该如何解决这个问题?
map.check_email "users/check_email", :controller => "users", :action => "check_email" map.resources :usersIn the tutorial it tells me to add this to my routes.rb but i get the error
undefined local variable or method `map' for #<ActionDispatch::Routing::Mapper:0x5f8f308>I'm using rails 3.0.9, how do i fix this?
最满意答案
在rails 3中,你不会再使用map.resources
只是使用resources :users
请参阅本指南以了解Rails 3中的路由:
http://guides.rubyonrails.org/routing.html
如果你想为check_mail指定一个特定的路由名称,比如
www.myapp.com/check_mail你可以在你的路线中做到这一点:
match 'check_mail' => "users#check_mail"in rails 3 you dont't use anymore map.resources
just use resources :users instead
refer to this guide for routing in Rails 3:
http://guides.rubyonrails.org/routing.html
if you want a specific route name for check_mail, like
www.myapp.com/check_mail you could do this in your routes:
match 'check_mail' => "users#check_mail"更多推荐
发布评论