rubyforgood / pet-rescue

Pet Rescue 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
61 stars 105 forks source link

Display "Featured pets" on the org home page #558

Closed nsiwnf closed 3 months ago

nsiwnf commented 6 months ago

Randomly select 4 of the org's adoptable_pets to display on the home page. Change copy under the pet image to "Adopt [pet's name] ->" as shown below.

Screen Shot 2024-03-17 at 6 54 57 PM
DreamVenerable commented 6 months ago

I can take this!

VonTeacher commented 5 months ago

@DreamVenerable @nsiwnf Any progress on this? If not, I can take care of it this weekend.

DreamVenerable commented 5 months ago

I got busy and totally forgot about it 😅

You are free to take it!

VonTeacher commented 5 months ago

OK, thanks for the response. If you want, I can ping you when it's ready for review. :)

@nsiwnf, pinging for reassignment.

kasugaijin commented 5 months ago

@VonTeacher All yours!

VonTeacher commented 5 months ago

I have a sample of pet cards displaying on the organization's HomeController, but I'm unsure of the best or established pattern in the repository for that query and creation of the instance variable in app/controllers/organizations/home_controller.rb, so feedback is particularly welcome.

kasugaijin commented 5 months ago

Can you make a draft PR with your approach? It's easier to comment on the existing code and gives you a chance to choose a solution. I see what you mean though, it's a one-off type of query that doesn't relate particularly well to any specific model, enough to put on a model for example.

Edit: I took a look at your PR and think the approach is fine. Review to follow!

kasugaijin commented 4 months ago

@VonTeacher I will unassign so someone else can finish this off. But, let me know if you want to finish it!

Just a couple comments to address in the PR (delete some tests). It should be a quick fix. https://github.com/rubyforgood/pet-rescue/pull/660

meg-gutshall commented 3 months ago

Closed by #784