Skip to content

Instantly share code, notes, and snippets.

@SofiaSousa
Last active August 9, 2022 08:30
Show Gist options
  • Save SofiaSousa/977454068614ab82f6bd18e1641f27a2 to your computer and use it in GitHub Desktop.
Save SofiaSousa/977454068614ab82f6bd18e1641f27a2 to your computer and use it in GitHub Desktop.
stimulus html 1
<%= turbo_frame_tag "results" do %>
<section data-controller="results-toggle"
data-results-toggle-visible-value="true"
data-results-toggle-hidden-class="hidden">
<button data-action="click->results-toggle#toggle">Hide Results</button>
<div data-results-toggle-target="elementToHide">
<% @items.each do |item| %>
<%= render item %>
<% end %>
</div>
</section>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment