1

当我单击主页按钮时,Rails 将指向默认的“欢迎加入您正在使用 Ruby on Rails!” 首次安装 ROR 后加载的页面。不知道为什么位于 app/views/static_pages/home.html.erb 的文件没有加载。

这是我的路线文件。

SampleApp::Application.routes.draw do
resources :users do
    member do
        get :following, :followers
    end
end
resources :sessions, only: [:new, :create, :destroy]
resources :microposts, only: [:create, :destroy]
resources :relationships, only: [:create, :destroy]

root to: 'static_pages#home'

match '/static_pages/home', :to =>'static_pages#home'

# resource to get the standard actions for sessions
match '/signup', to: 'users#new'
match '/signin', to: 'sessions#new'
match '/signout', to: 'sessions#destroy', via: :delete
end
4

1 回答 1

5

index.html从文件夹中删除public:)

于 2013-09-12T14:56:06.280 回答