OSDN Git Service

t#31060:add export
[pettanr/pettanr.git] / app / controllers / demander_statuses_controller.rb
index c936bbb..180f3ee 100644 (file)
@@ -38,7 +38,8 @@ class DemanderStatusesController < ApplicationController
     @demander_status = DemanderStatus.edit(params[:id], @admin)
     respond_to do |format|
       if @demander_status.approve params[:demander_status][:receive_hour1], params[:demander_status][:receive_hour2]
-        format.html { redirect_to @demander_status, notice: 'DemanderStatus was successfully updated.' }
+        flash[:notice] = I18n.t('demander_statuses.flash.notice.approved')
+        format.html { redirect_to @demander_status }
         format.json { head :ok }
       else
         format.html { render action: "edit" }
@@ -51,10 +52,12 @@ class DemanderStatusesController < ApplicationController
     @demander_status = DemanderStatus.edit(params[:id], @admin)
     respond_to do |format|
       if @demander_status.reject
-        format.html { redirect_to @demander_status, notice: 'DemanderStatus was successfully rejected.' }
+        flash[:notice] = I18n.t('demander_statuses.flash.notice.rejected')
+        format.html { redirect_to @demander_status }
         format.json { head :ok }
       else
-        format.html { redirect_to @demander_status, notice: 'DemanderStatus was not rejected.' }
+        flash[:notice] = I18n.t('demander_statuses.flash.notice.not_rejected')
+        format.html { redirect_to @demander_status }
         format.json { render json: @demander_status.errors, status: :unprocessable_entity }
       end
     end