Commit 2bebac97bb5eaa3b893692f2d21e1569c8cab338
1 parent
aac11a50
Exists in
master
and in
1 other branch
Changing votes_by_session_ids to listen to POST because of URI limit
Showing
2 changed files
with
3 additions
and
2 deletions
Show diff stats
app/controllers/visitors_controller.rb
| 1 | 1 | class VisitorsController < InheritedResources::Base |
| 2 | 2 | respond_to :xml, :json |
| 3 | 3 | before_filter :authenticate |
| 4 | + | |
| 4 | 5 | def votes_by_session_ids |
| 5 | 6 | session_ids = params[:session_ids] |
| 6 | 7 | |
| ... | ... | @@ -16,7 +17,7 @@ class VisitorsController < InheritedResources::Base |
| 16 | 17 | end |
| 17 | 18 | |
| 18 | 19 | respond_to do |format| |
| 19 | - format.xml{ render :xml => votes_by_session_id.to_xml and return} | |
| 20 | + format.json { render :json => votes_by_session_id.to_json and return} | |
| 20 | 21 | end |
| 21 | 22 | end |
| 22 | 23 | ... | ... |
config/routes.rb
| 1 | 1 | ActionController::Routing::Routes.draw do |map| |
| 2 | 2 | #map.resources :clicks |
| 3 | - map.resources :visitors, :collection => {:votes_by_session_ids => :get} | |
| 3 | + map.resources :visitors, :collection => {:votes_by_session_ids => :post} | |
| 4 | 4 | map.resources :questions, :member => { :object_info_totals_by_date => :get, :num_votes_by_visitor_id => :get, :export => :post, :set_autoactivate_ideas_from_abroad => :put, :activate => :put, :suspend => :put}, :collection => {:recent_votes_by_question_id => :get} do |question| |
| 5 | 5 | question.resources :items |
| 6 | 6 | question.resources :prompts, :member => {:vote_left => :post, :vote_right => :post, :skip => :post, :vote => :post}, | ... | ... |