This commit is contained in:
albert
2012-01-13 19:18:09 -05:00
parent e534a06680
commit d05622b5cb
3 changed files with 17 additions and 2 deletions

View File

@@ -3,7 +3,12 @@ class PoolElementsController < ApplicationController
before_filter :member_only
def create
@pool = Pool.find_by_name(params[:pool_name]) || Pool.find(params[:pool_id])
@pool = Pool.find_by_name(params[:pool_name]) || Pool.find_by_id(params[:pool_id])
if @pool.nil?
return
end
@post = Post.find(params[:post_id])
@pool.add!(@post)
append_pool_to_session(@pool)