Fix #4982: Add route to remove a post from a favorite group
This commit is contained in:
@@ -59,4 +59,12 @@ class FavoriteGroupsController < ApplicationController
|
||||
|
||||
respond_with(@favorite_group)
|
||||
end
|
||||
|
||||
def remove_post
|
||||
@favorite_group = authorize FavoriteGroup.find(params[:id])
|
||||
@post = Post.find(params[:post_id])
|
||||
@favorite_group.remove(@post)
|
||||
|
||||
respond_with(@favorite_group)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user