Use success notices where appropriate
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Râu Cao
2023-02-18 10:07:54 +08:00
parent b7bf957dd2
commit 346e36e160
2 changed files with 18 additions and 4 deletions

View File

@@ -33,7 +33,11 @@ class Admin::DonationsController < Admin::BaseController
respond_to do |format|
if @donation.save
format.html { redirect_to admin_donation_url(@donation), notice: 'Donation was successfully created.' }
format.html do
redirect_to admin_donation_url(@donation), flash: {
success: 'Donation was successfully created.'
}
end
format.json { render :show, status: :created, location: @donation }
else
format.html { render :new }
@@ -47,7 +51,11 @@ class Admin::DonationsController < Admin::BaseController
def update
respond_to do |format|
if @donation.update(donation_params)
format.html { redirect_to admin_donation_url(@donation), notice: 'Donation was successfully updated.' }
format.html do
redirect_to admin_donation_url(@donation), flash: {
success: 'Donation was successfully updated.'
}
end
format.json { render :show, status: :ok, location: @donation }
else
format.html { render :edit }
@@ -61,7 +69,10 @@ class Admin::DonationsController < Admin::BaseController
def destroy
@donation.destroy
respond_to do |format|
format.html { redirect_to admin_donations_url, notice: 'Donation was successfully destroyed.' }
format.html do redirect_to admin_donations_url, flash: {
success: 'Donation was successfully destroyed.'
}
end
format.json { head :no_content }
end
end