Show More
Commit Description:
* DRY the toggle button via application_helper.rb#toggle_button and _toggle_button.js.haml...
Commit Description:
* DRY the toggle button via application_helper.rb#toggle_button and _toggle_button.js.haml * bootrapize the user_admin * now considering user.enabled * tidy up route
File last commit:
Show/Diff file:
Action:
app/views/problems/toggle.js.haml | 8 lines | 296 B | text/x-haml | HamlLexer |
= render partial: 'toggle_button',
locals: {button_id: "#problem-avail-#{@problem.id}",button_on: @problem.available }
:plain
r = $("#prob-#{@problem.id}");
r.removeClass('success');
r.removeClass('danger');
r.addClass("#{@problem.available? ? 'success' : 'danger'}");