From aeeef64c83f3288278add7d3f5503e3a58d5ab5d Mon Sep 17 00:00:00 2001 From: f Date: Sat, 10 Feb 2018 20:11:47 -0300 Subject: [PATCH] los javascripts en sus propios archivos --- app/assets/javascripts/select2.js | 3 +++ app/views/posts/_form.haml | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 app/assets/javascripts/select2.js 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: [',']}); - });