OSDN Git Service

t30329#:i18n flash message
[pettanr/pettanr.git] / app / controllers / authors_controller.rb
index 50adf08..7acfbf5 100644 (file)
@@ -69,7 +69,8 @@ class AuthorsController < ApplicationController
     @au.overwrite @user.id
     respond_to do |format|
       if @au.save
-        format.html { redirect_to root_path, notice: 'Author was successfully created.' }
+        flash[:notice] = I18n.t('flash.notice.created', :model => Author.model_name.human)
+        format.html { redirect_to root_path }
         format.json { render json: @au.to_json(Author.show_json_opt), status: :created, location: @artist }
       else
         format.html { render action: "new" }
@@ -85,7 +86,8 @@ class AuthorsController < ApplicationController
 
     respond_to do |format|
       if @au.save
-        format.html { redirect_to '/home/configure', notice: 'Author was successfully updated.' }
+        flash[:notice] = I18n.t('flash.notice.updated', :model => Author.model_name.human)
+        format.html { redirect_to '/home/configure' }
         format.json { head :ok }
       else
         format.html { render action: "edit" }