Created
October 29, 2016 10:58
-
-
Save anonymous/d356b680d8723117dadb04ef45c44af7 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| | |
@ajax_status_text = if @quiz.active | |
"Successfully activated quiz" | |
else | |
"Successfully deactivated quiz." | |
end | |
@flash_status = if @quiz.active | |
"success" | |
else | |
"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