-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
Description
I don't super understand exactly what happened here. I was doin a lil something like this:
class PageForm < ApplicationForm
def template
div do
collection(:responses).each do |response_fields|
response = response_fields.object
item = response.item
options = item.options.pluck(:id, :label)
render response_fields.field(:option_id).radio(options)
end
end
end
endAnd whenever I'd assign the params it seemed like the NamespaceCollection was building the namespaces array twice, overwriting the first, so that my namespaces didn't have any children, so no update was made.
This makes it work. I'm not really sure why.
module Superform
class NamespaceCollection < Node
def enumerate(enumerable)
enumerable.map.with_index do |object, key|
build_namespace(key, object:)
end
end
end
endMetadata
Metadata
Assignees
Labels
No labels