开发者

about rails3 routes match

开发者 https://www.devze.com 2023-01-23 23:21 出处:网络
i have a usercenter/users_controller,in this controller have code like belows def login end def forgot end

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

精彩评论

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