Skip to content

Instantly share code, notes, and snippets.

@ashaw
Created October 15, 2010 14:16
Show Gist options
  • Save ashaw/628247 to your computer and use it in GitHub Desktop.
Save ashaw/628247 to your computer and use it in GitHub Desktop.
def multi
poll_ids = params[:id].split(',')
@polls = Poll.find(:all, :conditions => {:id => poll_ids})
json = @polls.to_json(:include => {:contest => {}, :pollster => {}, :scores => {:include => :candidate}})
json = params[:callback] ? params[:callback] + '(' + json + ')' : json
respond_to do |format|
format.json { render :json => json }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment