Permalink
Browse files

stub questions controller

  • Loading branch information...
1 parent 6f415d5 commit 1aa0f99834e6e730488950544c756aa363d4752b @danchoi danchoi committed Jan 31, 2012
Showing with 13 additions and 0 deletions.
  1. +10 −0 app/controllers/questions_controller.rb
  2. +3 −0 config/routes.rb
@@ -23,4 +23,14 @@ def index
render :json => @questions
end
+
+
+ # Vote is too ancillary to deserve a full controller
+
+ def vote
+ @question = Question.find params[:id]
+ @question.vote_up(request.remote_ip)
+ render head: :ok
+ end
+
end
View
@@ -10,6 +10,8 @@
get "/shows/:show_id/questions/:user_id/latest" => "questions#latest"
+ post "question/:id/votes" => "questions#vote"
+
resources :authentications
resources :subscribers
resources :shows do
@@ -18,4 +20,5 @@
resources :questions
end
+
end

0 comments on commit 1aa0f99

Please sign in to comment.