This works, but I am sure there is a better way todo this:
GET /posts/1/edit
def edit @post = Post.find(params[:id])
# Find user galleries that have not been used in posts yet
usergalleries = Array.new @post.user.galleries.each do |pug|
usergalleries << pug.id
end
userpostgalleries = Array.new @post.user.posts.each do |pup|
userpostgalleries << pup.gallery_id
end
aug = usergalleries - userpostgalleries @availableusergalleries = @post.user.galleries.find
(:all, :conditions => { :id => aug })
end