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

Working follow button

parent 155072aa
...@@ -12,7 +12,7 @@ class FriendsController < ApplicationController ...@@ -12,7 +12,7 @@ class FriendsController < ApplicationController
user = User.find(params[:id]) user = User.find(params[:id])
mastodon_uid = user.authorizations.find_by(provider: :mastodon).uid mastodon_uid = user.authorizations.find_by(provider: :mastodon).uid
mastodon_client.follow_by_uri(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 end
private private
......
...@@ -3,11 +3,18 @@ ...@@ -3,11 +3,18 @@
<head> <head>
<title>MastodonBridge</title> <title>MastodonBridge</title>
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
<%= stylesheet_link_tag 'application', media: 'all' %> <%= stylesheet_link_tag 'application', media: 'all' %>
</head> </head>
<body> <body>
<% if flash[:notice] %>
<p><strong><%= flash[:notice] %></strong></p>
<% end %>
<% if flash[:alert] %>
<p><strong><%= flash[:alert] %></strong></p>
<% end %>
<%= yield %> <%= yield %>
</body> </body>
</html> </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