Commit 29968c85 authored by Eugen Rochko's avatar Eugen Rochko

Working follow button

parent 155072aa
......@@ -12,7 +12,7 @@ class FriendsController < ApplicationController
user = User.find(params[:id])
mastodon_uid = user.authorizations.find_by(provider: :mastodon).uid
mastodon_client.follow_by_uri(mastodon_uid)
redirect_to friends_path
redirect_to friends_path, notice: "Successfully followed #{mastodon_uid} from your Mastodon account"
end
private
......
......@@ -3,11 +3,18 @@
<head>
<title>MastodonBridge</title>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'application', media: 'all' %>
</head>
<body>
<% if flash[:notice] %>
<p><strong><%= flash[:notice] %></strong></p>
<% end %>
<% if flash[:alert] %>
<p><strong><%= flash[:alert] %></strong></p>
<% end %>
<%= yield %>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment