Visitar URL original
Double Output When Rendering HAML Partials Containing Form Helpers · Issue #1607 · ViewComponent/view_component · GitHub
Skip to content

Double Output When Rendering HAML Partials Containing Form Helpers #1607

Closed

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

Activity

  1. Aesthetikx commented on Dec 13, 2022

    @Aesthetikx
    Author

    For easy access, this partial is rendered here, and the component is rendered here.

  2. Aesthetikx commented on Dec 13, 2022

    @Aesthetikx
    Author

    Possibly related to #241.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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