Skip to content

Instantly share code, notes, and snippets.

@donrestarone
Created December 25, 2020 15:20
Show Gist options
  • Save donrestarone/29b41049ecba0838b6c3f33633991f6d to your computer and use it in GitHub Desktop.
Save donrestarone/29b41049ecba0838b6c3f33633991f6d to your computer and use it in GitHub Desktop.
turbo frame partial rails 6
<%= turbo_frame_tag dom_id(tweet) do %>
<div class="card m-4">
<div class="card-body">
<%= tweet.content %>
</div>
<div class="card-footer bg-transparent border-success">
<%= link_to 'Show', tweet, class: 'btn btn-sm btn-primary text-white' %>
<%= link_to 'Edit', edit_tweet_path(tweet), class: 'btn btn-sm btn-warning text-white', remote: true %>
<%= link_to 'Destroy', tweet, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-danger text-white' %>
</div>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment