@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" }
@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