-
Notifications
You must be signed in to change notification settings - Fork 476
Document how to use blocks with lambda slots #1318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for the approval, @camertron. Any thoughts on how we can get the Lint check passing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sampart would you be willing to add a test for this use case? I think it would be helpful to verify that the documentation we are adding is 1) correct and 2) remains correct ❤️
Co-authored-by: Joel Hawksley <joel@hawksley.org>
Co-authored-by: Joel Hawksley <joel@hawksley.org>
@sampart sorry about that lint check, I fixed it in master and merged the change into this branch. Should be good to go now. |
Co-authored-by: Joel Hawksley <joel@hawksley.org>
@joelhawksley sorry for the delay; I've now added a test in 625c7d7. I hope it's the kind of thing you were intending. Thanks |
Thank you! |
* Document how to use blocks with lambda slots * Update CHANGELOG * Add self to contributors list * Remove trailing whitespace * Wording tweaks from code review Co-authored-by: Joel Hawksley <joel@hawksley.org> * Pass block to content_tag differently Co-authored-by: Joel Hawksley <joel@hawksley.org> * Add test for providing lambda slot content via block ViewComponent#1318 (review) * Update doc test to match altered sample code Co-authored-by: Joel Hawksley <joel@hawksley.org> * Fix linter violation * Apply suggestions from code review Co-authored-by: Cameron Dutro <camertron@gmail.com> Co-authored-by: Joel Hawksley <joel@hawksley.org>
* Document how to use blocks with lambda slots * Update CHANGELOG * Add self to contributors list * Remove trailing whitespace * Wording tweaks from code review Co-authored-by: Joel Hawksley <joel@hawksley.org> * Pass block to content_tag differently Co-authored-by: Joel Hawksley <joel@hawksley.org> * Add test for providing lambda slot content via block ViewComponent#1318 (review) * Update doc test to match altered sample code Co-authored-by: Joel Hawksley <joel@hawksley.org> * Fix linter violation * Apply suggestions from code review Co-authored-by: Cameron Dutro <camertron@gmail.com> Co-authored-by: Joel Hawksley <joel@hawksley.org>
Summary
Adds documentation for how to render block content in a lambda slot.
It may just be that I'm a relative ruby newbie, but this felt like a gap in the documentation to me. It's also very different to how component slots do it, since the
content
method isn't available.Other Information
As requested in https://github.com/github/view_component/blob/main/docs/CONTRIBUTING.md#submitting-a-pull-request, I've added this change to the CHANGELOG and my avatar to the docs, even though this change is very minor. But I won't be offended if you deem neither of those changes necessary for such a small PR 😸