Skip to content

Commit

Permalink
Merge pull request #11 from IkumaTadokoro/remove-unused-files
Browse files Browse the repository at this point in the history
自動生成された不要なファイルを削除
  • Loading branch information
IkumaTadokoro committed Dec 28, 2020
2 parents 8618d79 + 63fa6cb commit 2a9e9b8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 32 deletions.
3 changes: 0 additions & 3 deletions app/assets/stylesheets/books.scss

This file was deleted.

34 changes: 9 additions & 25 deletions app/controllers/books_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ class BooksController < ApplicationController
before_action :set_book, only: %i[show edit update destroy]

# GET /books
# GET /books.json
def index
@books = Book.all
end

# GET /books/1
# GET /books/1.json
def show; end

# GET /books/new
Expand All @@ -22,43 +20,29 @@ def new
def edit; end

# POST /books
# POST /books.json
def create
@book = Book.new(book_params)

respond_to do |format|
if @book.save
format.html { redirect_to @book, notice: t('notice.create') }
format.json { render :show, status: :created, location: @book }
else
format.html { render :new }
format.json { render json: @book.errors, status: :unprocessable_entity }
end
if @book.save
redirect_to @book, notice: t('notice.create')
else
render :new
end
end

# PATCH/PUT /books/1
# PATCH/PUT /books/1.json
def update
respond_to do |format|
if @book.update(book_params)
format.html { redirect_to @book, notice: t('notice.update') }
format.json { render :show, status: :ok, location: @book }
else
format.html { render :edit }
format.json { render json: @book.errors, status: :unprocessable_entity }
end
if @book.update(book_params)
redirect_to @book, notice: t('notice.update')
else
render :edit
end
end

# DELETE /books/1
# DELETE /books/1.json
def destroy
@book.destroy
respond_to do |format|
format.html { redirect_to books_url, notice: t('notice.destroy') }
format.json { head :no_content }
end
redirect_to books_url, notice: t('notice.destroy')
end

private
Expand Down
2 changes: 0 additions & 2 deletions app/views/books/_book.json.jbuilder

This file was deleted.

1 change: 0 additions & 1 deletion app/views/books/index.json.jbuilder

This file was deleted.

1 change: 0 additions & 1 deletion app/views/books/show.json.jbuilder

This file was deleted.

0 comments on commit 2a9e9b8

Please sign in to comment.