diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d9fd83f..9345777 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -21,10 +21,13 @@ //= require_tree . ready = function() { - $(".select2-selector").select2({ - width: 'resolve', - placeholder: "Ontvanger" - }); + $.each($(".select2-selector"), function(index, val) { + $(val).select2({ + width: 'resolve', + placeholder: $(".select2-selector") + }); + } + ) } $(document).ready(ready) diff --git a/app/views/transactions/_new.html.haml b/app/views/transactions/_new.html.haml index 1ae6c04..1df3aee 100644 --- a/app/views/transactions/_new.html.haml +++ b/app/views/transactions/_new.html.haml @@ -7,7 +7,7 @@ = f.select :creditor, options_from_collection_for_select(User.all.order(:name), :name, :name), { include_blank: true }, - { class: 'select2-selector form-control', size: 50, required: true } + { class: 'select2-selector', size: 50, required: true, data: { placeholder: "Creditor" } } = f.text_field :message, placeholder: "Message", size: 75, class: "form-control", required: true .input-group %span.input-group-addon diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index f0dddc6..ebe49ee 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -35,7 +35,9 @@ .row .col-md-4 .input-listen{ 'data-input-type': 'text', 'data-filter-name': 'Issuer' } - %input{type: 'text', placeholder: 'Filter on Issuer', class: "form-control" } + = grouped_collection_select :nil, :nil, [User, Client], :all, :name, :name, :name, + { include_blank: true }, + { data: { placeholder: "Filter on Issuer" }, class: "select2-selector form-control" } .col-md-4 .input-listen{ 'data-input-type': 'text', 'data-filter-name': 'Peer' } %input{type: 'text', placeholder: 'Filter on Peer', class: "form-control" }