rails_admin_selectize 0.1.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/rails_admin_selectize/thecore_rails_admin.js +1 -0
- data/app/assets/stylesheets/rails_admin_selectize/thecore_rails_admin.scss +3 -0
- data/app/views/rails_admin/main/_form_selectize.html.haml +2 -1
- data/config/initializers/rails_admin_selectize_app_configs.rb +9 -0
- data/lib/rails_admin_selectize.rb +11 -13
- data/lib/rails_admin_selectize/engine.rb +9 -0
- data/lib/rails_admin_selectize/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a694ef611b4a46bdae86d8667c4a2f9667383747ff1dfc38f119bc25b9598a75
|
4
|
+
data.tar.gz: faa5656472f2a06911d7aed89352474b111582c97eda880df3c78219528833d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d1fbe0d298ca1cf3d80d27a4b49470168aea22c83a60fa4a833a8338f1b564772422d6b793ddeb1bc46542e4dd5f399839c145556eb818e95e6f988df830128
|
7
|
+
data.tar.gz: 2b3d5077539911e27b9a818d52adaf0980fe1efed2f07044203fa868b4835aee36236883e142fe142ba7d89620ab33275eab65dc40729cf3637fcd20b266bcb6
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require selectize
|
@@ -38,7 +38,8 @@
|
|
38
38
|
|
39
39
|
:javascript
|
40
40
|
const selectizeField = $("##{field.abstract_model.to_s.parameterize.underscore}_#{field.method_name}")
|
41
|
-
selectizeField.selectize(selectizeField.data('options'))
|
41
|
+
// selectizeField.selectize(selectizeField.data('options'))
|
42
|
+
selectizeField.selectize()
|
42
43
|
if (selectizeField.parents("#modal").length) {
|
43
44
|
selectizeField.siblings('.btn').remove();
|
44
45
|
} else {
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
config.assets.paths << root.join("app", "assets", "stylesheets", "rails_admin_selectize")
|
3
|
+
config.assets.paths << root.join("app", "assets", "javascripts", "rails_admin_selectize")
|
4
|
+
# Pages under Rails Admin
|
5
|
+
config.assets.precompile += %w( rails_admin_selectize/thecore_rails_admin.css rails_admin_selectize/thecore_rails_admin.js )
|
6
|
+
|
7
|
+
config.after_initialize do
|
8
|
+
end
|
9
|
+
end
|
@@ -1,12 +1,10 @@
|
|
1
1
|
require "rails_admin_selectize/engine"
|
2
|
-
|
3
|
-
module RailsAdminSelectize
|
4
|
-
# Your code goes here...
|
5
|
-
end
|
6
|
-
|
7
2
|
require 'selectize-rails'
|
8
3
|
require 'rails_admin/config/fields/types/has_many_association'
|
9
4
|
|
5
|
+
module RailsAdminSelectize
|
6
|
+
end
|
7
|
+
|
10
8
|
module RailsAdmin
|
11
9
|
module Config
|
12
10
|
module Fields
|
@@ -24,13 +22,13 @@ module RailsAdmin
|
|
24
22
|
end
|
25
23
|
end
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
25
|
+
RailsAdmin::Config::Fields.register_factory do |parent, properties, fields|
|
26
|
+
if properties.name == :selectize
|
27
|
+
fields << RailsAdmin::Config::Fields::Types::Selectize.new(parent, properties[:name], properties)
|
28
|
+
true
|
29
|
+
else
|
30
|
+
false
|
31
|
+
end
|
32
|
+
end
|
35
33
|
|
36
34
|
|
@@ -1,4 +1,13 @@
|
|
1
1
|
module RailsAdminSelectize
|
2
2
|
class Engine < ::Rails::Engine
|
3
|
+
# appending migrations to the main app's ones
|
4
|
+
initializer 'rails_admin_selectize.append_migrations' do |app|
|
5
|
+
unless app.root.to_s.match root.to_s
|
6
|
+
config.paths["db/migrate"].expanded.each do |expanded_path|
|
7
|
+
app.config.paths["db/migrate"] << expanded_path
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
3
12
|
end
|
4
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin_selectize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -62,7 +62,10 @@ files:
|
|
62
62
|
- MIT-LICENSE
|
63
63
|
- README.md
|
64
64
|
- Rakefile
|
65
|
+
- app/assets/javascripts/rails_admin_selectize/thecore_rails_admin.js
|
66
|
+
- app/assets/stylesheets/rails_admin_selectize/thecore_rails_admin.scss
|
65
67
|
- app/views/rails_admin/main/_form_selectize.html.haml
|
68
|
+
- config/initializers/rails_admin_selectize_app_configs.rb
|
66
69
|
- lib/rails_admin_selectize.rb
|
67
70
|
- lib/rails_admin_selectize/engine.rb
|
68
71
|
- lib/rails_admin_selectize/version.rb
|
@@ -85,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
88
|
- !ruby/object:Gem::Version
|
86
89
|
version: '0'
|
87
90
|
requirements: []
|
88
|
-
rubygems_version: 3.0.
|
91
|
+
rubygems_version: 3.0.3
|
89
92
|
signing_key:
|
90
93
|
specification_version: 4
|
91
94
|
summary: Add Selectize as a field.
|