2014-12-06 75 views
1

我抄在welcome控制器下面幾頁將在根命名空間一個控制器的路徑

views/welcome/about.haml 
views/welcome/brand.haml 
views/welcome/brand_detail.haml 
views/welcome/contact.haml 
views/welcome/download.haml 
views/welcome/faq.haml 
views/welcome/news.haml 
views/welcome/news_detail.haml 
views/welcome/product.haml 
views/welcome/product_detail.haml 

現在,我寫我的路線這樣

get 'welcome/index' 
    get 'welcome/about' 

似乎重複welcome多次和命名空間不在根目錄下。

回答

0

寫在你的的routes.rb文件

root 'welcome#index' 
1

如果我理解正確的話,你想在你config/routes.rb如下:

get 'about', to: 'welcome#about' 
get 'brand', to: 'welcome#brand' 

... and so on ... 

root 'welcome#index'