rubytaiwan / AMA

:thought_balloon: Civilized Discussion :speech_balloon:
https://github.com/rubytaiwan/AMA
116 stars 13 forks source link

如何寫route才能讓 `/dashboard/admin/` 變成 `/` #90

Closed LukaHuang closed 8 years ago

LukaHuang commented 9 years ago

如題我想讓根目錄網址對應到dashboard/admin但是不知道如何撰寫route.rb

chinghanho commented 9 years ago
root "dashboad#index"
get "dashboard/admin" => "dashboad#index"
get "/" => "dashboad#index"
get "/" => redirect("/dashboard/admin")

不曉得你要的是 redirect,還是說不同路徑,要有相同的行為。

LukaHuang commented 8 years ago

@chinghanho 大大您好 我是想要把"dashboard/admin "的網址對應到"/" 方便測試 看來似乎得用get "/" => "/dashboar/admin/"