Skip to content

Double Output When Rendering HAML Partials Containing Form Helpers #1607

@Aesthetikx

Description

@Aesthetikx

When using view component (ERB, HAML, whatever) to render a form,
and then rendering a partial from that component,
if that component is both written in HAML and contains a tag like fields_for,
the output will be doubled.

This does not happen if the partial doesn't contain such a tag, or if the partial is written in ERB, or if the partial is rendered from a normal view without VC. So, all three conditions are required.

Steps to reproduce

Here is a link to a repository demonstrating the behavior: https://github.com/Aesthetikx/view_component_haml_partial_double

Expected behavior

plain_form

Actual behavior

haml_partial

System configuration

Rails 7.0.4
Ruby 3.1.2
ViewComponent 2.79.0
HAML 6.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions