improvements to pool add

This commit is contained in:
albert
2013-02-17 23:39:43 -05:00
parent 2af59642f6
commit ae082cda48
4 changed files with 26 additions and 10 deletions

View File

@@ -5,14 +5,12 @@ class PoolElementsController < ApplicationController
def create
@pool = Pool.find_by_name(params[:pool_name]) || Pool.find_by_id(params[:pool_id])
if @pool.nil?
return
if @pool.present?
@post = Post.find(params[:post_id])
@pool.add!(@post)
append_pool_to_session(@pool)
end
@post = Post.find(params[:post_id])
@pool.add!(@post)
append_pool_to_session(@pool)
respond_with(@pool, :location => post_path(@post))
end