Make country select searchable in registrar form

This commit is contained in:
Martin Lensment 2014-10-07 17:04:25 +03:00
parent fd74733931
commit e3d8ea088b
6 changed files with 11 additions and 1 deletions

View file

@ -61,6 +61,9 @@ gem 'devise', '~> 3.3.0'
# for archiving
gem 'paper_trail', '~> 3.0.5'
# for select
gem 'selectize-rails', '~> 0.11.0'
group :assets do
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby

View file

@ -218,6 +218,7 @@ GEM
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
selectize-rails (0.11.0)
shoulda-matchers (2.6.2)
activesupport (>= 3.0.0)
simplecov (0.9.1)
@ -302,6 +303,7 @@ DEPENDENCIES
rspec-rails (~> 3.0.2)
sass-rails (~> 4.0.3)
sdoc (~> 0.4.0)
selectize-rails (~> 0.11.0)
shoulda-matchers (~> 2.6.1)
simplecov (~> 0.9.1)
simpleidn (~> 0.0.5)

View file

@ -1,4 +1,5 @@
ready = ->
$('.selectize').selectize();
$(document).ready(ready)
$(document).on('page:load', ready)

View file

@ -7,6 +7,8 @@
#= require typeahead.bundle.min
#= require autocomplete
#= require jquery.nested_attributes
#= require selectize
#= require app
NProgress.configure
showSpinner: false

View file

@ -4,4 +4,6 @@
@import "nprogress-bootstrap";
@import "bootstrap-ext";
@import "typeaheadjs";
@import "selectize";
@import "selectize.bootstrap3";
@import "app";

View file

@ -21,7 +21,7 @@
.col-md-6.text-left
.form-group
= f.label :country_id
= f.select :country_id, options_for_select(Country.all.map{|x| [x.name, x.id]}, @registrar.country_id), {}, {class: 'form-control'}
= f.select :country_id, options_for_select(Country.all.map{|x| [x.name, x.id]}, @registrar.country_id), {}, {class: 'form-control selectize'}
.form-group
= f.label :address
= f.text_field(:address, class: 'form-control')