Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

stub questions controller

  • Loading branch information...
commit 1aa0f99834e6e730488950544c756aa363d4752b 1 parent 6f415d5
Daniel Choi danchoi authored
10 app/controllers/questions_controller.rb
@@ -23,4 +23,14 @@ def index
23 23
24 24 render :json => @questions
25 25 end
  26 +
  27 +
  28 + # Vote is too ancillary to deserve a full controller
  29 +
  30 + def vote
  31 + @question = Question.find params[:id]
  32 + @question.vote_up(request.remote_ip)
  33 + render head: :ok
  34 + end
  35 +
26 36 end
3  config/routes.rb
@@ -10,6 +10,8 @@
10 10
11 11 get "/shows/:show_id/questions/:user_id/latest" => "questions#latest"
12 12
  13 + post "question/:id/votes" => "questions#vote"
  14 +
13 15 resources :authentications
14 16 resources :subscribers
15 17 resources :shows do
@@ -18,4 +20,5 @@
18 20 resources :questions
19 21 end
20 22
  23 +
21 24 end

0 comments on commit 1aa0f99

Please sign in to comment.
Something went wrong with that request. Please try again.