i have a usercenter/users_controller,in this controller have code like belows
def login
end
def forgot
end
def reset_password
end
each method mapping a view login.html.erb, forgot.html.erb,reset_password.html.erb
now i want make a route for them at /usercenter/login /usercenter/forgot /usercenter/reset_password
how could i write route file ?
also i have a relevent question is is there s开发者_C百科ome easy way for reduce write route mapping code because i have many controller method follow this rule
I think what you are looking for is named routes. Check this http://guides.rubyonrails.org/routing.html#controller-namespaces-and-routing
精彩评论