开发者

Routing Error - No route matches "/"?

开发者 https://www.devze.com 2023-01-20 04:31 出处:网络
new to Ruby on Rails, trying to configure the home page of my application. I don\'t know what I\'m doing wrong, or how to configure the :home controller, but I get this erro开发者_StackOverflow中文版r

new to Ruby on Rails, trying to configure the home page of my application. I don't know what I'm doing wrong, or how to configure the :home controller, but I get this erro开发者_StackOverflow中文版r with this routes.rb file.

Routing Error - No route matches "/"

Here's routes.rb

SchoolCMS::Application.routes.draw do
  devise_for :teachers, :admin

  resources :home, :only => :index

  resources :admin, :only => :index

  resources :events do
    resources :event
  end

  resources :posts do
    resources :comments
  end  

end

This is my home_controller.rb

class HomeController < ApplicationController
  def index
  end

end

If I'm going about this all wrong, it would be great if you could recommend some resources I could read.


I think you just need this:

root :to => "home#index"
0

精彩评论

暂无评论...
验证码 换一张
取 消