-
Notifications
You must be signed in to change notification settings - Fork 443
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
Failing test case using image_tag and tag slot #1885
base: main
Are you sure you want to change the base?
Conversation
Thanks @hchtlz for opening this! I think I understand what happens here:
Now... I'm not sure how we want to address this:
|
What would be your preferred approach for handling this @camertron @BlakeWilliams @boardfish? |
@Spone what if we just raised an error if you tried to define a slot with the same name as an already-defined method? We actually already do this for polymorphic slot setters. |
Sounds good. I'll work with @hchtlz on this. |
Let's see if we need to do that for |
Co-authored-by: Hans Lemuet <[email protected]>
Co-authored-by: Hans Lemuet <[email protected]>
The failure in the Primer ViewComponents check comes from this component in Lookbook: https://github.com/ViewComponent/lookbook/blob/main/app/components/lookbook/icon_button/component.rb#L3C5-L3C51 We're calling But actually, I'm not sure whether we need this check for @allmarkedup mind chiming in? |
Currently, view_component/lib/view_component/slotable.rb Line 153 in b11ba1f
The check for plural slot name conflicting with singular slot name has been introduced in #1455, but I'm not sure if I understand why that would be an issue (aside from being very confusing when you read the component). |
I'm attempting to address an unexpected test failure that occurred while using the renders_one :tag feature in my component. The issue seems to be connected to the use of the image_tag method within the same component. The specific error message I encountered is:
I suspect that the issue may be related to the naming conflict between renders_one :tag and the image_tag method within the same component. When I changed the name "tag" to something different, the test case ran without any issues.