diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 850a046..3533954 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -15,4 +15,6 @@ $(function() { $("input[data-behavior=auto-select]").click(function() { this.select(); }); + + $('input[data-behavior=focus]:first').focus(); }); diff --git a/app/views/users/new.html.slim b/app/views/users/new.html.slim index bd0296f..827c2b5 100644 --- a/app/views/users/new.html.slim +++ b/app/views/users/new.html.slim @@ -7,7 +7,7 @@ section.supplimental h3 Pick your username: = simple_form_for @user, :url => user_path do |f| - = f.input :nickname, label: 'Username', required: true + = f.input :nickname, label: 'Username', required: true, input_html: { 'data-behavior' => 'focus' } = f.button :submit hr