Skip to content

Conversation

sampart
Copy link
Contributor

@sampart sampart commented Mar 25, 2022

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 😸

@sampart sampart requested review from a team and BlakeWilliams as code owners March 25, 2022 16:50
@sampart
Copy link
Contributor Author

sampart commented Mar 29, 2022

Thanks for the approval, @camertron. Any thoughts on how we can get the Lint check passing?

Copy link
Member

@joelhawksley joelhawksley left a 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 ❤️

sampart and others added 2 commits April 7, 2022 11:18
Co-authored-by: Joel Hawksley <joel@hawksley.org>
Co-authored-by: Joel Hawksley <joel@hawksley.org>
@camertron
Copy link
Contributor

@sampart sorry about that lint check, I fixed it in master and merged the change into this branch. Should be good to go now.

@sampart
Copy link
Contributor Author

sampart commented Apr 20, 2022

@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

@sampart sampart requested a review from joelhawksley April 20, 2022 09:55
@joelhawksley joelhawksley merged commit 450b261 into main Apr 20, 2022
@joelhawksley joelhawksley deleted the document-lambda-slots-and-blocks branch April 20, 2022 18:37
@sampart
Copy link
Contributor Author

sampart commented Apr 21, 2022

Thank you!

claudiob pushed a commit to claudiob/view_component that referenced this pull request Dec 22, 2023
* 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>
claudiob pushed a commit to claudiob/view_component that referenced this pull request Jan 3, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants