OSDN Git Service

t#31537:fix flash
[pettanr/pettanr.git] / app / controllers / comics_controller.rb
index 848e4b2..c5f8546 100644 (file)
@@ -90,6 +90,7 @@ class ComicsController < ApplicationController
         format.html { redirect_to @comic }
         format.json { render json: @comic.to_json(Comic.show_json_opt), status: :created, location: @comic }
       else
+        flash[:notice] = I18n.t('flash.notice.not_created', :model => Comic.model_name.human)
         format.html { render action: "new" }
         format.json { render json: @comic.errors, status: :unprocessable_entity }
       end
@@ -106,6 +107,7 @@ class ComicsController < ApplicationController
         format.html { redirect_to @comic }
         format.json { head :ok }
       else
+        flash[:notice] = I18n.t('flash.notice.not_updated', :model => Comic.model_name.human)
         format.html { render action: "edit" }
         format.json { render json: @comic.errors, status: :unprocessable_entity }
       end