Known issues
There remain several known issues with ViewComponent. We’d be thrilled to see you consider solutions to these thorny bugs!
Forms don’t use the default FormBuilder
Calls to form helpers such as form_with
in ViewComponents don’t use the default form builder. This is by design, as it allows global state to change the rendered output of a component. Instead, consider passing a form builder into form helpers via the builder
argument:
<%= form_for(record, builder: CustomFormBuilder) do |f| %>
<%= f.text_field :name %>
<% end %>
Incompatibility with active_scaffold
Due to active_scaffold
’s monkey-patching of render
that hasn’t been updated to support renderable objects like ViewComponents, it’s impossible to use active_scaffold
alongside view_component
.