rails_admin_select2 0.0.2.pre → 0.0.3.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
1
- <%= form.select(field.method_name, field.collection, { :include_blank => true }, { :class => 'select2', :style => 'width:75%', :multiple => field.multiple? }) %>
1
+ <%- input_id = "#{field.abstract_model.to_s.underscore}_#{field.method_name}" %>
2
+ <%= form.select(field.method_name, field.collection, { :include_blank => true }, { :class => 'select2', :style => 'width:75%', :id => input_id, :multiple => field.multiple? }) %>
2
3
  <script type="text/javascript">
3
- $(<%= "#{field.abstract_model.to_s.underscore}_#{field.method_name}" %>).select2();
4
+ $(<%= input_id %>).select2();
4
5
  </script>
@@ -1,6 +1,7 @@
1
1
  <%- tags_value = field.value || '' %>
2
2
  <%- tags_predefined = "[%s]" % field.tags.map{ |t| "\"#{t.to_s}\"" }.join(',') %>
3
- <%= form.hidden_field(field.method_name, { :class => 'select2', :style => 'width:75%', :value => tags_value }) %>
3
+ <%- input_id = "#{field.abstract_model.to_s.underscore}_#{field.method_name}" %>
4
+ <%= form.hidden_field(field.method_name, { :class => 'select2', :id => input_id, :style => 'width:75%', :value => tags_value }) %>
4
5
  <script type="text/javascript">
5
- $(<%= "#{field.abstract_model.to_s.underscore}_#{field.method_name}" %>).select2({ tags: <%= tags_predefined.html_safe %> });
6
+ $(<%= input_id %>).select2({ tags: <%= tags_predefined.html_safe %> });
6
7
  </script>
@@ -1,7 +1,7 @@
1
1
  module RailsAdminSelect2
2
2
  MAJOR = '0'
3
3
  MINOR = '0'
4
- PATCH = '2'
4
+ PATCH = '3'
5
5
  PRE = 'pre'
6
6
  VERSION = [ MAJOR, MINOR, PATCH, PRE ].join('.')
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_select2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.pre
4
+ version: 0.0.3.pre
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -71,7 +71,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
71
71
  version: '0'
72
72
  segments:
73
73
  - 0
74
- hash: 652118273
74
+ hash: 458538799
75
75
  required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  none: false
77
77
  requirements: