Skip to content

Commit

Permalink
Adding the ability to actually disable questions
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin Fonacier committed Dec 18, 2009
1 parent dbefec1 commit 7f2e049
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/controllers/questions_controller.rb
Expand Up @@ -82,6 +82,13 @@ def update
end
end

def disable
@question = Question.find(params[:id])
@question.disable = true
@question.save!
head :ok
end

# /questions/admin
def admin
@questions = Question.all_ready_to_go
Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/application.js
Expand Up @@ -16,6 +16,6 @@ $(document).ready(function(){
var parent_tr = $(this).parents("tr")[0];
$(parent_tr).slideUp();
var id = $(parent_tr).attr("id");
// AJAX the update POST
$.post("/questions/"+id+"/disable", { _method: "put", authenticity_token: encodeURIComponent(window._auth_token)});
});
});

0 comments on commit 7f2e049

Please sign in to comment.