ctrl+s keyboard shortcut in svbtle

Mac
open the console cmd + option + J

$(window).on('keydown', function (event) {
    if (event.metaKey && event.which === 83) {
        event.preventDefault();
        $('.save_button a').click();
    }
});

close the console

Linux
open the console ctrl + shift + J

$(window).on('keydown', function (event) {
    if (event.ctrlKey && event.which === 83) {
        event.preventDefault();
        $('.save_button a').click();
    }
});

close the console

 
1
Kudos
 
1
Kudos

Now read this

Conditional Custom Templates with Action Pack Variants

tl;dr Variants were introduced in Rails 4.1 making it possible to conditionally render a view template. Before Rails 4.1 we employed a custom technique dubbed MultipleTemplates to provide similar functionality. Here we present our... Continue →