Skip to content

Collection field components with block support #124

@rowofpixels

Description

@rowofpixels

I saw this comment in a past PR: #29 (comment) about adding collections without the block support first. I read through a number of issues in https://github.com/github/view_component related to form fields and it seems like it's not a simple problem to solve.

I'm curious whether there is a plan to support these fields when used with a block like so:

<%= f.collection_check_boxes :ids, MyModel.all, :id, :name do |b| %>
  <%= b.check_box %>
  <%= b.label %>
<% end %>

Right now the issue is that b is the component object rather than a builder object. I'm not sure what the right approach would be in a view component form builder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions