Skip to content

Conversation

excid3
Copy link
Contributor

@excid3 excid3 commented Jul 30, 2025

Motivation / Background

This adds a new tutorial adding Wishlists to the e-commerce store as a follow-up to the Sign Up & Settings Guide. It builds upon the Rails knowledge learned so far and helps reinforce the concepts learned so far.

cc @AmandaPerino

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@rails-bot rails-bot bot added the docs label Jul 30, 2025
@excid3 excid3 changed the title Wishlists guide [RF-DOCS] Wishlists guide Jul 30, 2025
@AmandaPerino AmandaPerino added the rails foundation Rails Foundation PRs label Jul 30, 2025
@AmandaPerino AmandaPerino self-requested a review July 30, 2025 19:11
Comment on lines +6 to +8
This guide covers adding Wishlists to the store e-commerce application in the
[Getting Started Guide](getting_started.html)). We will use the code from the
[Sign up and Settings Guide](sign_up_and_settings.html) as a starting place.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wishlist: have all the code from the previous guides ready so I don't have to follow them all before starting this one haha.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That isn't a bad idea. Maybe we should put the getting started code in a repository that people can clone?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A problem is that the repo would get out of sync as we update the tutorials.

Copy link
Contributor

@AmandaPerino AmandaPerino Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This came up in conversation with @excid3 when we were updating the Getting Started Guide, but the longterm maintenance as @MatheusRich says would be an issue.
@rafaelfranca Could this be in the Rails GitHub or would do you think an external repo is better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an external repo. There are ways to make maintenance easier. We could write a script that generate the repo and keep it inside the repo and make sure its content is the same as the guide.

Comment on lines +6 to +8
This guide covers adding Wishlists to the store e-commerce application in the
[Getting Started Guide](getting_started.html)). We will use the code from the
[Sign up and Settings Guide](sign_up_and_settings.html) as a starting place.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That isn't a bad idea. Maybe we should put the getting started code in a repository that people can clone?

```ruby
class Wishlist < ApplicationRecord
belongs_to :user
has_many :wishlist_products, dependent: :destroy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the proper name for this association and the model would be wishlisted_products, no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be, if you think of this as an adjective ("products that were wishlisted"), but wishlist_products also work as "products that are on a wishlist".

require "test_helper"

class WishlistTest < ActiveSupport::TestCase
test "has friendly urls" do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK how I feel about this test. This seems mostly to be testing Rails code (which we should assume is tested). Maybe we could test that we can find it? Or maybe no test for this at all, since the integration specs will catch it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I'll swap this with a test for filter_by since that is something actually worth unit testing.

Copy link
Contributor

@MatheusRich MatheusRich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @excid3! Great tutorial, as always. I learned something new today!

excid3 and others added 8 commits August 27, 2025 09:43
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Matheus Richard <matheusrichardt@gmail.com>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
excid3 and others added 19 commits August 27, 2025 09:44
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Matheus Richard <matheusrichardt@gmail.com>
Co-authored-by: Matheus Richard <matheusrichardt@gmail.com>
Co-authored-by: Matheus Richard <matheusrichardt@gmail.com>
Co-authored-by: Matheus Richard <matheusrichardt@gmail.com>
Co-authored-by: Matheus Richard <matheusrichardt@gmail.com>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs rails foundation Rails Foundation PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants