rubyforgood / homeward-tails

Homeward Tails is an application making it easy to link adopters/fosters with pets. We work with grassroots pet rescue organizations to understand how we can make the most impact.
MIT License
69 stars 117 forks source link

Fix validations in the pet form #368

Closed kasugaijin closed 10 months ago

kasugaijin commented 11 months ago

The pet form does not show validations as it should when data are not valid or missing. There are HTML validations in use, but we also need active record validations that bootstrap form then turns into error messages that display under the input field.

This PR did fix it, but something got broken in the meantime: https://github.com/rubyforgood/pet-rescue/pull/260

Acceptance criteria:

image

diegolinhares commented 11 months ago

Can I get this one?

diegolinhares commented 11 months ago

Here the validations are working as you can see:

errors
kasugaijin commented 11 months ago

Hey @diegolinhares sure! Yes they work in the org settings form but not in the pet create/edit form. The image provided is an example of how it should work, not the form with the issue.

kasugaijin commented 11 months ago

@diegolinhares how's this going? Do you still want to take it on?

atbalaji commented 10 months ago

Hi @diegolinhares , in case of reassigning the issue if it is available, I would love to work on this issue. Done some preliminary investigations. Would be happy to help 👍

kasugaijin commented 10 months ago

@diegolinhares let me know if you want to keep this or I'll reassign to @atbalaji in a couple days if I don't hear back. Thanks.

kasugaijin commented 10 months ago

@atbalaji all yours!

kasugaijin commented 10 months ago

I will close this as the validations are working fine in the pet form!

atbalaji commented 10 months ago

Hi @kasugaijin , I have a doubt. On testing locally, pets/new was fine with active records validations being displayed under the form field. But pets/edit was not displaying the errors due to the after_action: set_reason_paused_to_none, only [:update] in PetsController. Was this taken care of ? Would love to know .

kasugaijin commented 10 months ago

@atbalaji oh good find. It had beena while since I created this issue and today I noted create form was working fine but did not test update. Feel free to make a PR if you have found an issue and a fix!

It was likely the error you mention in the update form that led me to make this issue in the first place...I cannot recall.

kasugaijin commented 10 months ago

Note that #387 is a new issue that might take care of this also. It is to remove the pause reason column and associated logic.

atbalaji commented 10 months ago

Yeah fix for #387 will take care of this issue too. Cool @kasugaijin , happy to contribute in case of new issues👍.

kasugaijin commented 10 months ago

@atbalaji should be more issues opening up in the next couple of days!