开发者

about rails3 routes match

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜