diff --git a/app/assets/javascripts/select2.js b/app/assets/javascripts/select2.js new file mode 100644 index 0000000..32b1729 --- /dev/null +++ b/app/assets/javascripts/select2.js @@ -0,0 +1,3 @@ +$(document).on('turbolinks:load', function() { + $('.select2').select2({ tags: true, tokenSeparators: [',']}); +}); diff --git a/app/views/posts/_form.haml b/app/views/posts/_form.haml index e4bb175..ac52eea 100644 --- a/app/views/posts/_form.haml +++ b/app/views/posts/_form.haml @@ -120,8 +120,3 @@ %small.text-muted.form-text= t('posts.lang_help') .form-group = submit_tag t('posts.save'), class: 'btn btn-success' - -:javascript - $(document).on('turbolinks:load', function() { - $('.select2').select2({ tags: true, tokenSeparators: [',']}); - });