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/application/_toggle_button.js.haml | 7 lines | 231 B | text/x-haml | HamlLexer |
:plain
var t = $("#{button_id}");
t.removeClass('btn-default');
t.removeClass('btn-success');
t.removeClass('btn-warning');
t.addClass("btn-#{button_on ? 'success' : 'default'}");
t.text("#{button_on ? 'Yes' : 'No'}");