Ruby on Rails根目录:'static_pages #home'不链接

时间:2013-09-12 14:54:38

标签: ruby-on-rails webpage

当我点击主页按钮时,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

1 个答案:

答案 0 :(得分:5)

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