ruby 2.2.2p95
Rails 4.2.4
Mac
以下のエラーが出ており、困っております。
ActionController::RoutingError (No route matches [GET] "/books_path"
http://localhost:3000/
のページは見られます。
http://localhost:3000/books_path
に遷移した際に、エラーがでます。
以下、原因になりうるところを記述しました。
config/routes.rb
resources :books
記述の仕方の問題かと思い、以下のようなやり方も試しました。
get "rentals/index"
rake routes
books GET /books(.:format) books#index POST /books(.:format) books#create new_book GET /books/new(.:format) books#new edit_book GET /books/:id/edit(.:format) books#edit book GET /books/:id(.:format) books#show PATCH /books/:id(.:format) books#update PUT /books/:id(.:format) books#update DELETE /books/:id(.:format) books#destroy
app/controllers/books_controller.rb
class BooksController < ApplicationController before_action :set_book, only: [:show, :edit, :update, :destroy] def index @books = Book.all end def show end def new @book = Book.new end . . . . end
また、
app/views/books/index.html.erb
も作っております。
今回の挙動に関係ありそうなgem
gem 'devise' gem 'twitter-bootstrap-rails' gem 'therubyracer' gem 'less-rails'
以上宜しくお願いします。
※情報不足な点が御座いましたら、追記します。
回答1件
あなたの回答
tips
プレビュー