Commit 32ff3ef0858b1214a96c88f08c67dd43c56ecdb5

Authored by Pius Uzamere
1 parent 0be5d2e8

proper ChoicesController#show method

Showing 1 changed file with 3 additions and 5 deletions   Show diff stats
app/controllers/choices_controller.rb
@@ -23,12 +23,10 @@ class ChoicesController < InheritedResources::Base @@ -23,12 +23,10 @@ class ChoicesController < InheritedResources::Base
23 end 23 end
24 24
25 def show 25 def show
26 - @question = Question.find(params[:question_id])  
27 - @prompt = @question.prompts.find(params[:id])  
28 show! do |format| 26 show! do |format|
29 - format.xml { render :xml => @prompt.to_xml(:methods => [:left_choice_text, :right_choice_text])}  
30 - format.json { render :json => @prompt.to_json(:methods => [:left_choice_text, :right_choice_text])}  
31 - end 27 + format.xml { render :xml => @choice.to_xml(:methods => [:data, :votes_count, :wins_plus_losses])}
  28 + format.json { render :json => @choice.to_json(:methods => [:data])}
  29 + end
32 end 30 end
33 31
34 def single 32 def single