Created
October 29, 2016 11:04
-
-
Save anonymous/16d65c98cf9d9c4afd2cf7d5ffbb66f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def toggle_quiz | |
if @quiz.update_attributes(active: params[:active]) | |
respond_to do |format| | |
if @quiz.active | |
@ajax_status_text = "Successfully activated quiz" | |
@flash_status = "success" | |
else | |
@ajax_status_text = "Successfully deactivated quiz." | |
@flash_status = "warning" | |
end | |
format.js | |
end | |
else | |
@ajax_status_text = "Request Failed" | |
@flash_status = "error" | |
format.js | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment