view_components icon indicating copy to clipboard operation
view_components copied to clipboard

Content renders twice when rendering a layout in a ViewComponent

Open kellymason opened this issue 3 years ago • 2 comments

I created a ViewComponent based on an existing rails view that renders a layout. The ViewComponent template file looked something like this:

<%= render layout: "path/to/layout/file" do %>
  <%= form_tag example_path,  method: :put do %>
      # some form code here
  <%= end %>
<% end %>

When viewing my component in the UI, I saw the form_tag and everything inside it rendering twice - once above the layout, and once within the layout.

I'm not sure it's a common occurrence to have a layout file in a ViewComponent, and I plan on working around it by converting the layout to its own ViewComponent.

kellymason avatar Mar 02 '22 19:03 kellymason

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.

github-actions[bot] avatar Aug 29 '22 19:08 github-actions[bot]

Hi @kellymason, so sorry we didn't get back to you on this! Do you know if this is still a valid issue?

lesliecdubs avatar Sep 02 '22 03:09 lesliecdubs