OSDN Git Service

t#31537:fix flash
[pettanr/pettanr.git] / app / controllers / artists_controller.rb
index 28bd0c1..dbcfab5 100644 (file)
@@ -105,6 +105,7 @@ class ArtistsController < ApplicationController
         format.html { redirect_to root_path }
         format.json { render json: @ar.to_json(Artist.show_json_opt), status: :created, location: @artist }
       else
+        flash[:notice] = I18n.t('flash.notice.not_created', :model => Artist.model_name.human)
         format.html { render action: "new" }
         format.json { render json: @ar.errors, status: :unprocessable_entity }
       end
@@ -124,6 +125,7 @@ class ArtistsController < ApplicationController
         format.html { redirect_to '/home/configure' }
         format.json { head :ok }
       else
+        flash[:notice] = I18n.t('flash.notice.not_updated', :model => Artist.model_name.human)
         format.html { render action: "edit" }
         format.json { render json: @ar.errors, status: :unprocessable_entity }
       end