Skip to content

Instantly share code, notes, and snippets.

@catmando
Created February 26, 2021 05:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catmando/13ed081255728ba766c824703249b656 to your computer and use it in GitHub Desktop.
Save catmando/13ed081255728ba766c824703249b656 to your computer and use it in GitHub Desktop.
Hyperstack vs Hotwire _tweet.html.erb
<%= turbo_frame_tag dom_id(tweet) do %>
<div class="card card-body">
<div><%= tweet.body %></div>
<div class="mt-2">
<%= button_to "Likes (#{tweet.likes_count})", tweet_like_path(tweet), method: :post %>
<%= button_to "Retweets (#{tweet.retweets_count})", tweet_retweet_path(tweet), method: :post %>
<%= link_to "Edit", edit_tweet_path(tweet) %>
</div>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment