2012-12-08 57 views
0

我已經產生了新的模型:新模式索引頁,顯示其他模型索引頁

軌生成腳手架網站

然後我試圖顯示所有條目,但而不是顯示/它顯示的網站/設備

> rake routes 
> test_on GET /test/on(.:format)    test#on 
     test_off GET /test/off(.:format)    test#off 
     power_on GET /power/on(.:format)    power#on 
     power_off GET /power/off(.:format)    power#off 
     power_cycle GET /power/cycle(.:format)   power#cycle 
     home_index GET /home/index(.:format)    home#index 
     devices_new GET /devices/new(.:format)   devices#new 
    devices_destroy DELETE /devices/destroy(.:format)  devices#destroy 
    turnon_device PUT /devices/:id/turnon(.:format)  devices#turnon 
    turnoff_device PUT /devices/:id/turnoff(.:format) devices#turnoff 
powercycle_device PUT /devices/:id/powercycle(.:format) devices#powercycle 
    getsites_device GET /devices/:id/getsites(.:format) devices#getsites 
      devices GET /devices(.:format)    devices#index 
        POST /devices(.:format)    devices#create 
     new_device GET /devices/new(.:format)   devices#new 
     edit_device GET /devices/:id/edit(.:format)  devices#edit 
      device GET /devices/:id(.:format)   devices#show 
        PUT /devices/:id(.:format)   devices#update 
        DELETE /devices/:id(.:format)   devices#destroy 
      users GET /users(.:format)     users#index 
        POST /users(.:format)     users#create 
     new_user GET /users/new(.:format)    users#new 
     edit_user GET /users/:id/edit(.:format)   users#edit 
      user GET /users/:id(.:format)    users#show 
        PUT /users/:id(.:format)    users#update 
        DELETE /users/:id(.:format)    users#destroy 
      sites GET /sites(.:format)     sites#index 
        POST /sites(.:format)     sites#create 
     new_site GET /sites/new(.:format)    sites#new 
     edit_site GET /sites/:id/edit(.:format)   sites#edit 
      site GET /sites/:id(.:format)    sites#show 
        PUT /sites/:id(.:format)    sites#update 
        DELETE /sites/:id(.:format)    sites#destroy 
      root  /        devices#index 

感謝所有幫助 謝謝 d

+0

我看到你的'網站'路線在那裏列出。問題是什麼? – bricker

+0

當轉到本地主機:3000 /網站,它出現作爲本地主機:3000 /設備 –

回答

0

您的意思是?你有兩個:

 devices GET /devices(.:format)    devices#index 
     sites GET /sites(.:format)     sites#index 

你能寫一些關於你的問題的更好的解釋嗎?

+0

當我去本地主機:3000 /網站,它作爲本地主機:3000 /設備 –

+0

是和如果我去的網站,一些因爲它只顯示我在application.html.erb –

+0

好吧,這不是你原來的問題;)有很多原因,用戶可能被重定向到設備@索引,而不是站點#indes,我會幫助你與調試。 – rorra