Not able to unsubscribe after clicking following button of a tag. #2010
Labels
bug
the issue is regarding one of our programs which faces problems when a certain task is executed
first-timers-only
They need to be well-formatted using the First-timers_Issue_Template.
help wanted
requires help by anyone willing to contribute
HTML
Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.
If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!
If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!
The problem
A user is not able to click the following button again to unfollow the specific tag but is just redirected to that tag page.
What's supposed to happen:
If user is already following the topic this clicking this button again should unsubscribe the user from that topic.
What actually does happen:
User is just redirected to the specific topic page.
Solution
Where to find the relevant lines of code:
https://github.com/publiclab/plots2/blob/master/app/views/home/subscriptions.html.erb#L9
https://github.com/publiclab/plots2/blob/master/app/views/tag/show.html.erb#L47
What to change them to:
We need to add
data-method="delete"
to the above mentioned two lines.<a rel="tooltip" title="<%= t('home.subscriptions.click_unfollow') %>" class="btn btn-default active" href="/unsubscribe/tag/everything"><i class="fa fa-eye"></i> <%= t('home.subscriptions.following') %> <b><%= t('home.subscriptions.research_notes') %></b></a>
to
<a rel="tooltip" title="<%= t('home.subscriptions.click_unfollow') %>" class="btn btn-default active" href="/unsubscribe/tag/everything" data-method="delete"><i class="fa fa-eye"></i> <%= t('home.subscriptions.following') %> <b><%= t('home.subscriptions.research_notes') %></b></a>
and
<a rel="tooltip" title="<%= t('home.subscriptions.click_unfollow') %>" class="btn btn-default active" href="/unsubscribe/tag/everything"><i class="fa fa-eye"></i> <%= t('home.subscriptions.following') %> <b><%= t('home.subscriptions.research_notes') %></b></a>
to
<a rel="tooltip" title="<%= t('home.subscriptions.click_unfollow') %>" class="btn btn-default active" href="/unsubscribe/tag/everything" data-method="delete"><i class="fa fa-eye"></i> <%= t('home.subscriptions.following') %> <b><%= t('home.subscriptions.research_notes') %></b></a>
Steps to Fix
Please email the developers list (see https://publiclab.org/wiki/developers) or go to the chatroom if you have questions, and take a look at our first-timers landing page for more information!
The text was updated successfully, but these errors were encountered: