Skip to content

Commit

Permalink
Update Redirect Behavior Based on Success of Pet Creation (#1342)
Browse files Browse the repository at this point in the history
* update redirect behavior on pet creation

redirect to show when pet creation is successful and redirect to index when pet creation is unsuccessful

* render new when pet creation fails
  • Loading branch information
cassieemb authored Jan 23, 2025
1 parent 6813f26 commit d9b63fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/organizations/staff/pets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def create
end

if @pet.persisted?
redirect_to staff_pets_path, notice: t(".success")
redirect_to staff_pet_path(@pet), notice: t(".success")
else
flash.now[:alert] = t(".error")
render :new, status: :unprocessable_entity
Expand Down

0 comments on commit d9b63fc

Please sign in to comment.