Unable to use _iteration
with with_collection_parameter
#1129
-
I don't know if this is the right approach but I am trying to create a container for the components rendered with a Anyway, this is my component: class ChecklistAnswerComponent < ViewComponent::Base
with_collection_parameter :data
def initialize(data:, data_iteration:)
@data = data
@iteration = data_iteration
end
end As you can see it is really simple but the thing that I do not understand is why Does any of you have an idea of why it is happening or probably have a better way to create a container for a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Seems to me like you're doing the right thing here according to the docs. Maybe there's an underlying issue at play here? If you could pull together an isolated example repo (e.g. by starting with |
Beta Was this translation helpful? Give feedback.
-
@boardfish thanks for the quick response and the advice. Set up the I've updated ViewComponent and everything started to work. So lesson learned: keep your gem updated 😂 |
Beta Was this translation helpful? Give feedback.
@boardfish thanks for the quick response and the advice.
Set up the
--minimal
repo and everything worked out of the box. Turns out that in the project I am working on we used ver 2.24 and even if I checked #306 I didn't notice when this has been merged.I've updated ViewComponent and everything started to work.
So lesson learned: keep your gem updated 😂