Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

this should fix the follow/unfollow feature #1

Open
wants to merge 1 commit into from

1 participant

@Ir1sh

I have only tested this on rails 4 but I think it will work on the original aswell.

first github pull request WOOHOO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 2, 2013
  1. @Ir1sh
This page is out of date. Refresh to see the latest.
View
2  app/controllers/relationships_controller.rb
@@ -15,6 +15,6 @@ def create
def destroy
@relationship = Relationship.find(params[:id])
@relationship.destroy
- redirect_to user_path params[:id]
+ redirect_to user_path(@relationship.followed_id)
end
end
View
2  app/views/users/show.html.erb
@@ -21,7 +21,7 @@
</p>
<% if current_user and @user != current_user %>
<% if current_user.following? @user %>
- <%= form_tag relationship_path, method: :delete do %>
+ <%= form_tag relationship_path(@relationship), method: :delete do %>
<%= submit_tag "Unfollow" %>
<% end %>
<% else %>
Something went wrong with that request. Please try again.