diff --git a/app/controllers/follows_controller.rb b/app/controllers/follows_controller.rb index 66fbb6a50..a9db098c0 100644 --- a/app/controllers/follows_controller.rb +++ b/app/controllers/follows_controller.rb @@ -4,13 +4,13 @@ class FollowsController < ApplicationController def create @follow.save! - flash.now[:notice] = t("shared.followable.#{followable_translation_key(@follow.followable)}.create.notice") + flash.now[:notice] = t("shared.followable.#{followable_translation_key(@follow)}.create.notice") render :refresh_follow_button end def destroy @follow.destroy! - flash.now[:notice] = t("shared.followable.#{followable_translation_key(@follow.followable)}.destroy.notice") + flash.now[:notice] = t("shared.followable.#{followable_translation_key(@follow)}.destroy.notice") render :refresh_follow_button end @@ -24,7 +24,7 @@ class FollowsController < ApplicationController [:followable_type, :followable_id] end - def followable_translation_key(followable) - followable.class.name.parameterize(separator: "_") + def followable_translation_key(follow) + follow.followable.class.name.parameterize(separator: "_") end end