Files
danbooru/app/controllers/pools_posts_controller.rb
albert 6824e98af3 * Refactored routes some
* Fixed some major bugs with pools and pool versioning
2011-01-21 18:07:34 -05:00

19 lines
478 B
Ruby

class PoolsPostsController < ApplicationController
respond_to :html, :xml, :json
before_filter :member_only
def create
@pool = Pool.find(params[:pool_id])
@post = Post.find(params[:id])
@pool.add_post!(@post)
respond_with(@pool, :location => pool_path(@pool))
end
def destroy
@pool = Pool.find(params[:pool_id])
@post = Post.find(params[:id])
@pool.remove_post!(@post)
respond_with(@pool, :location => pool_path(@pool))
end
end