Skip to content

Commit

Permalink
Use form with normal-sized button on follows show pages
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Jan 17, 2025
1 parent 3eccf65 commit 84a9d71
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/views/follows/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<h1><%= t(@already_follows ? ".unfollow.heading" : ".follow.heading", :user => @friend.display_name) %></h1>
<% end %>

<%= link_to t(@already_follows ? ".unfollow.button" : ".follow.button"),
follow_path(:display_name => @friend.display_name, :referer => params[:referer]),
:method => (@already_follows ? :delete : :post),
:class => "btn btn-sm btn-primary" %>
<%= bootstrap_form_tag :method => (@already_follows ? :delete : :post) do |f| %>
<% if params[:referer] -%>
<%= f.hidden_field :referer, :value => params[:referer] %>
<% end -%>
<%= f.primary @already_follows ? t(".unfollow.button") : t(".follow.button") %>
<% end %>

0 comments on commit 84a9d71

Please sign in to comment.