当我点击主页按钮时,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
答案 0 :(得分:5)
从index.html
文件夹中删除public
:)