app/controllers/api/v1/preference_settings_controller.rb
# removing subreddits from preference_setting subreddits array
removing subreddits from preference_setting subreddits array
removing subreddits from preference_setting subreddits array
def destroy
    feed = current_user.preference_setting
    subreddit = eval(params['body'])[:subreddit]
    subreddit.downcase!
    if feed.subreddits.include?(subreddit) 
      feed.subreddits.delete(subreddit)
    end
    feed.save
    render json: { action: "Successfully Deleted"}
  end
def destroy feed = current_user . preference_setting subreddit = eval ( params [ 'body' ] ) [ :subreddit ] subreddit . downcase! if feed . subreddits . include? ( subreddit ) feed . subreddits . delete ( subreddit ) end feed . save render json : { action : "Successfully Deleted" } end
removing subreddits from preference_setting subreddits array
removing subreddits from preference_setting subreddits array