Skip to content

Setting properties on a form control when using the form builder #3195

Closed
@dereke

Description

I am trying to use the autocomplete component from within a form builder:

class MyForm < ApplicationForm
  form do |form|
    form.auto_complete(
      name: :skills,
      label: "Skills",
      placeholder: "Search skills library",
      required: true,
      list_id: "skills_autocomplete",
      src: "/skills/autocomplete?select_fields=id,name,description&search_field=name",
    )
  end
end

This renders a FormControl with the autocomplete inside and that is all great. However I want to set the form control to be full width. There is a property for this available on the form control but that seems to be inaccessible from here.

Is there a way to modify the values passed to the form control so we can set properties on it?

Thanks for your help

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions