私は確かにこれで頭を失い/眠りを失っています。これは私のquestions_controller.rbです
class QuestionsController < ApplicationController
# GET /questions
# GET /questions.json
def index
@questions = Question.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @questions }
end
end
これは私のapplications_controller.rbです
class ApplicationController < ActionController::Base
protect_from_forgery
end
これは私のレーキルートです:
questions GET /questions(.:format) questions#index
POST /questions(.:format) questions#create
new_question GET /questions/new(.:format) questions#new
edit_question GET /questions/:id/edit(.:format) questions#edit
question GET /questions/:id(.:format) questions#show
PUT /questions/:id(.:format) questions#update
DELETE /questions/:id(.:format) questions#destroy
home_index GET /home/index(.:format) home#index
これは私のroutes.rbです
App::Application.routes.draw do
resources :questions
end
に行く際のエラーhttp://0.0.0.0:3000/questions
uninitialized constant QuestionsController
エラーは何でしょうか?