From 289c22daa782a43ee45d61ff421e7a16cb0555fb Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Tue, 4 Jun 2024 16:28:26 +0300 Subject: [PATCH] Write changeset subscribe/unsubscribe buttons using tag.button --- app/views/changesets/show.html.erb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/views/changesets/show.html.erb b/app/views/changesets/show.html.erb index a30dc8c79..1d37e302a 100644 --- a/app/views/changesets/show.html.erb +++ b/app/views/changesets/show.html.erb @@ -18,9 +18,17 @@ <% if current_user %>
<% if @changeset.subscribers.exists?(current_user.id) %> - + <%= tag.button t("javascripts.changesets.show.unsubscribe"), + :class => "btn btn-sm btn-primary", + :name => "unsubscribe", + :data => { :method => "POST", + :url => api_changeset_unsubscribe_url(@changeset) } %> <% else %> - + <%= tag.button t("javascripts.changesets.show.subscribe"), + :class => "btn btn-sm btn-primary", + :name => "subscribe", + :data => { :method => "POST", + :url => api_changeset_subscribe_url(@changeset) } %> <% end %>
<% end %> -- 2.39.5