Files
danbooru/app/controllers/pool_elements_controller.rb
evazion 31e41b06ba pools: remove pool element destroy action.
This endpoint was for removing a single post from a pool. This wasn't
used anywhere within Danbooru.
2020-01-12 01:30:04 -06:00

16 lines
400 B
Ruby

class PoolElementsController < ApplicationController
respond_to :html, :xml, :json, :js
before_action :member_only
def create
@pool = Pool.find_by_name(params[:pool_name]) || Pool.find_by_id(params[:pool_id])
if @pool.present? && !@pool.is_deleted?
@post = Post.find(params[:post_id])
@pool.add!(@post)
else
@error = "That pool does not exist"
end
end
end