simple_form_custom_inputs 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +3 -0
  5. data/Gemfile +3 -0
  6. data/README.md +78 -0
  7. data/Rakefile +2 -0
  8. data/example/.gitignore +21 -0
  9. data/example/Gemfile +61 -0
  10. data/example/Gemfile.lock +206 -0
  11. data/example/README.md +24 -0
  12. data/example/Rakefile +6 -0
  13. data/example/app/assets/config/manifest.js +3 -0
  14. data/example/app/assets/images/.keep +0 -0
  15. data/example/app/assets/javascripts/application.js +19 -0
  16. data/example/app/assets/javascripts/cable.js +13 -0
  17. data/example/app/assets/javascripts/channels/.keep +0 -0
  18. data/example/app/assets/javascripts/posts.coffee +3 -0
  19. data/example/app/assets/stylesheets/application.scss +7 -0
  20. data/example/app/assets/stylesheets/posts.scss +3 -0
  21. data/example/app/assets/stylesheets/scaffolds.scss +89 -0
  22. data/example/app/channels/application_cable/channel.rb +4 -0
  23. data/example/app/channels/application_cable/connection.rb +4 -0
  24. data/example/app/controllers/application_controller.rb +3 -0
  25. data/example/app/controllers/concerns/.keep +0 -0
  26. data/example/app/controllers/posts_controller.rb +74 -0
  27. data/example/app/helpers/application_helper.rb +2 -0
  28. data/example/app/helpers/posts_helper.rb +2 -0
  29. data/example/app/jobs/application_job.rb +2 -0
  30. data/example/app/mailers/application_mailer.rb +4 -0
  31. data/example/app/models/application_record.rb +3 -0
  32. data/example/app/models/concerns/.keep +0 -0
  33. data/example/app/models/post.rb +2 -0
  34. data/example/app/views/layouts/application.html.erb +14 -0
  35. data/example/app/views/layouts/mailer.html.erb +13 -0
  36. data/example/app/views/layouts/mailer.text.erb +1 -0
  37. data/example/app/views/posts/_form.html.erb +13 -0
  38. data/example/app/views/posts/_post.json.jbuilder +2 -0
  39. data/example/app/views/posts/edit.html.erb +6 -0
  40. data/example/app/views/posts/index.html.erb +31 -0
  41. data/example/app/views/posts/index.json.jbuilder +1 -0
  42. data/example/app/views/posts/new.html.erb +5 -0
  43. data/example/app/views/posts/show.html.erb +19 -0
  44. data/example/app/views/posts/show.json.jbuilder +1 -0
  45. data/example/bin/bundle +3 -0
  46. data/example/bin/rails +9 -0
  47. data/example/bin/rake +9 -0
  48. data/example/bin/setup +34 -0
  49. data/example/bin/spring +17 -0
  50. data/example/bin/update +29 -0
  51. data/example/config.ru +5 -0
  52. data/example/config/application.rb +15 -0
  53. data/example/config/boot.rb +3 -0
  54. data/example/config/cable.yml +9 -0
  55. data/example/config/database.yml +25 -0
  56. data/example/config/environment.rb +5 -0
  57. data/example/config/environments/development.rb +54 -0
  58. data/example/config/environments/production.rb +86 -0
  59. data/example/config/environments/test.rb +42 -0
  60. data/example/config/initializers/application_controller_renderer.rb +6 -0
  61. data/example/config/initializers/assets.rb +11 -0
  62. data/example/config/initializers/backtrace_silencers.rb +7 -0
  63. data/example/config/initializers/cookies_serializer.rb +5 -0
  64. data/example/config/initializers/filter_parameter_logging.rb +4 -0
  65. data/example/config/initializers/inflections.rb +16 -0
  66. data/example/config/initializers/mime_types.rb +4 -0
  67. data/example/config/initializers/new_framework_defaults.rb +24 -0
  68. data/example/config/initializers/session_store.rb +3 -0
  69. data/example/config/initializers/simple_form.rb +169 -0
  70. data/example/config/initializers/simple_form_bootstrap.rb +154 -0
  71. data/example/config/initializers/wrap_parameters.rb +14 -0
  72. data/example/config/locales/en.yml +23 -0
  73. data/example/config/locales/simple_form.en.yml +31 -0
  74. data/example/config/puma.rb +47 -0
  75. data/example/config/routes.rb +4 -0
  76. data/example/config/secrets.yml +22 -0
  77. data/example/config/spring.rb +6 -0
  78. data/example/db/migrate/20170427011041_create_posts.rb +11 -0
  79. data/example/db/schema.rb +23 -0
  80. data/example/db/seeds.rb +7 -0
  81. data/example/lib/assets/.keep +0 -0
  82. data/example/lib/tasks/.keep +0 -0
  83. data/example/lib/templates/erb/scaffold/_form.html.erb +13 -0
  84. data/example/log/.keep +0 -0
  85. data/example/public/404.html +67 -0
  86. data/example/public/422.html +67 -0
  87. data/example/public/500.html +66 -0
  88. data/example/public/apple-touch-icon-precomposed.png +0 -0
  89. data/example/public/apple-touch-icon.png +0 -0
  90. data/example/public/favicon.ico +0 -0
  91. data/example/public/robots.txt +5 -0
  92. data/example/test/controllers/.keep +0 -0
  93. data/example/test/controllers/posts_controller_test.rb +48 -0
  94. data/example/test/fixtures/.keep +0 -0
  95. data/example/test/fixtures/files/.keep +0 -0
  96. data/example/test/fixtures/posts.yml +11 -0
  97. data/example/test/helpers/.keep +0 -0
  98. data/example/test/integration/.keep +0 -0
  99. data/example/test/mailers/.keep +0 -0
  100. data/example/test/models/.keep +0 -0
  101. data/example/test/models/post_test.rb +7 -0
  102. data/example/test/test_helper.rb +10 -0
  103. data/example/tmp/.keep +0 -0
  104. data/example/vendor/assets/javascripts/.keep +0 -0
  105. data/example/vendor/assets/stylesheets/.keep +0 -0
  106. data/lib/simple_form_custom_inputs.rb +7 -0
  107. data/lib/simple_form_custom_inputs/simple_form/switch_input.rb +11 -0
  108. data/lib/simple_form_custom_inputs/version.rb +3 -0
  109. data/screenshot.png +0 -0
  110. data/simple_form_custom_inputs.gemspec +23 -0
  111. data/vendor/assets/javascripts/.keep +0 -0
  112. data/vendor/assets/javascripts/simple_form_custom_inputs.js +22 -0
  113. metadata +182 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 19b3ada295b61b7233df2896ad2db91187cf861d
4
+ data.tar.gz: 11e3a7394298377fca09e9357111101e63a85dd5
5
+ SHA512:
6
+ metadata.gz: 44630a8757ad9581f5643d17f04733fe07141fccb05303e898ff3005167e250575096a3170873b2ebc036f840b8fc8253b1ee8b3c5c665d2d71181e2c52803e8
7
+ data.tar.gz: 05722a1c0f9d3a03244a6c604ebc6aacb48a9ae4ab5d1297fa43e789fb149592a65093d81daa64dab4972f63bc9dc97de2569cb12361e50673fac362b292f4f1
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.1
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+ # Specify your gem's dependencies in simple_form_custom_inputs.gemspec
3
+ gemspec
data/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # SimpleFormCustomInputs
2
+
3
+ ![](screenshot.png)
4
+
5
+ ## Availables inputs
6
+
7
+ - [x] Switch/Toggle with Switchery
8
+ - [ ] Datepicker
9
+ - [ ] Datetimepicker
10
+
11
+ ## Installation
12
+
13
+ Add the following gems to your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'simple_form'
17
+ gem 'simple_form_custom_inputs'
18
+
19
+ source 'https://rails-assets.org' do
20
+ gem 'rails-assets-switchery'
21
+ end
22
+ ```
23
+
24
+ And then execute:
25
+
26
+ ```bash
27
+ $ bundle install
28
+ $ rails generate simple_form:install
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ In app/assets/javascripts/application.js, you should add as follows:
34
+
35
+ ```js
36
+ //= require ...
37
+ //= require switchery
38
+ //= require simple_form_custom_inputs
39
+ //= require ...
40
+ ```
41
+
42
+ Application.scss
43
+
44
+ ```scss
45
+ @import "switchery";
46
+ ```
47
+
48
+ Basic Example:
49
+
50
+ ```erb
51
+ <%= simple_form_for :example do |f| %>
52
+ ...
53
+ <%= f.input :boolean, as: :switch %>
54
+ ...
55
+ <% end %>
56
+ ```
57
+
58
+ Want some more customization?
59
+
60
+ ```erb
61
+ <%= simple_form_for :example do |f| %>
62
+ ...
63
+ <%= f.input :boolean, as: :switch, input_html: {data: {color: '#FF0', secondary_color: '#0F0', jack_color: '#FFF', jack_secondary_color: '#000'}} %>
64
+ ...
65
+ <% end %>
66
+ ```
67
+
68
+ ## Sample projects
69
+
70
+ For an example, take a look at the `example` folder in this repository.
71
+
72
+ ## Contributing
73
+
74
+ 1. Fork it
75
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
76
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
77
+ 4. Push to the branch (`git push origin my-new-feature`)
78
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,21 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ /tmp/*
17
+ !/log/.keep
18
+ !/tmp/.keep
19
+
20
+ # Ignore Byebug command history file.
21
+ .byebug_history
data/example/Gemfile ADDED
@@ -0,0 +1,61 @@
1
+ source 'https://rubygems.org'
2
+
3
+ git_source(:github) do |repo_name|
4
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
5
+ "https://github.com/#{repo_name}.git"
6
+ end
7
+
8
+
9
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
10
+ gem 'rails', '~> 5.0.2'
11
+ # Use sqlite3 as the database for Active Record
12
+ gem 'sqlite3'
13
+ # Use Puma as the app server
14
+ gem 'puma', '~> 3.0'
15
+ # Use SCSS for stylesheets
16
+ gem 'sass-rails', '~> 5.0'
17
+ # Use Uglifier as compressor for JavaScript assets
18
+ gem 'uglifier', '>= 1.3.0'
19
+ # Use CoffeeScript for .coffee assets and views
20
+ gem 'coffee-rails', '~> 4.2'
21
+ # See https://github.com/rails/execjs#readme for more supported runtimes
22
+ # gem 'therubyracer', platforms: :ruby
23
+ gem 'pry-rails'
24
+
25
+ # Use jquery as the JavaScript library
26
+ gem 'jquery-rails'
27
+ # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
28
+ gem 'turbolinks', '~> 5'
29
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
30
+ gem 'jbuilder', '~> 2.5'
31
+ # Use Redis adapter to run Action Cable in production
32
+ # gem 'redis', '~> 3.0'
33
+ # Use ActiveModel has_secure_password
34
+ # gem 'bcrypt', '~> 3.1.7'
35
+
36
+ # Use Capistrano for deployment
37
+ # gem 'capistrano-rails', group: :development
38
+ gem 'simple_form'
39
+ gem 'simple_form_custom_inputs', path: '../'
40
+ gem 'bootstrap-sass'
41
+
42
+ source 'https://rails-assets.org' do
43
+ gem 'rails-assets-switchery'
44
+ end
45
+
46
+ group :development, :test do
47
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
48
+ gem 'byebug', platform: :mri
49
+ end
50
+
51
+ group :development do
52
+ # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
53
+ gem 'web-console', '>= 3.3.0'
54
+ gem 'listen', '~> 3.0.5'
55
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
56
+ gem 'spring'
57
+ gem 'spring-watcher-listen', '~> 2.0.0'
58
+ end
59
+
60
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
61
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
@@ -0,0 +1,206 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ simple_form_custom_inputs (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ remote: https://rails-assets.org/
9
+ specs:
10
+ actioncable (5.0.2)
11
+ actionpack (= 5.0.2)
12
+ nio4r (>= 1.2, < 3.0)
13
+ websocket-driver (~> 0.6.1)
14
+ actionmailer (5.0.2)
15
+ actionpack (= 5.0.2)
16
+ actionview (= 5.0.2)
17
+ activejob (= 5.0.2)
18
+ mail (~> 2.5, >= 2.5.4)
19
+ rails-dom-testing (~> 2.0)
20
+ actionpack (5.0.2)
21
+ actionview (= 5.0.2)
22
+ activesupport (= 5.0.2)
23
+ rack (~> 2.0)
24
+ rack-test (~> 0.6.3)
25
+ rails-dom-testing (~> 2.0)
26
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
+ actionview (5.0.2)
28
+ activesupport (= 5.0.2)
29
+ builder (~> 3.1)
30
+ erubis (~> 2.7.0)
31
+ rails-dom-testing (~> 2.0)
32
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
+ activejob (5.0.2)
34
+ activesupport (= 5.0.2)
35
+ globalid (>= 0.3.6)
36
+ activemodel (5.0.2)
37
+ activesupport (= 5.0.2)
38
+ activerecord (5.0.2)
39
+ activemodel (= 5.0.2)
40
+ activesupport (= 5.0.2)
41
+ arel (~> 7.0)
42
+ activesupport (5.0.2)
43
+ concurrent-ruby (~> 1.0, >= 1.0.2)
44
+ i18n (~> 0.7)
45
+ minitest (~> 5.1)
46
+ tzinfo (~> 1.1)
47
+ arel (7.1.4)
48
+ autoprefixer-rails (6.7.7.2)
49
+ execjs
50
+ bindex (0.5.0)
51
+ bootstrap-sass (3.3.7)
52
+ autoprefixer-rails (>= 5.2.1)
53
+ sass (>= 3.3.4)
54
+ builder (3.2.3)
55
+ byebug (9.0.6)
56
+ coderay (1.1.1)
57
+ coffee-rails (4.2.1)
58
+ coffee-script (>= 2.2.0)
59
+ railties (>= 4.0.0, < 5.2.x)
60
+ coffee-script (2.4.1)
61
+ coffee-script-source
62
+ execjs
63
+ coffee-script-source (1.12.2)
64
+ concurrent-ruby (1.0.5)
65
+ erubis (2.7.0)
66
+ execjs (2.7.0)
67
+ ffi (1.9.18)
68
+ globalid (0.4.0)
69
+ activesupport (>= 4.2.0)
70
+ i18n (0.8.1)
71
+ jbuilder (2.6.3)
72
+ activesupport (>= 3.0.0, < 5.2)
73
+ multi_json (~> 1.2)
74
+ jquery-rails (4.3.1)
75
+ rails-dom-testing (>= 1, < 3)
76
+ railties (>= 4.2.0)
77
+ thor (>= 0.14, < 2.0)
78
+ listen (3.0.8)
79
+ rb-fsevent (~> 0.9, >= 0.9.4)
80
+ rb-inotify (~> 0.9, >= 0.9.7)
81
+ loofah (2.0.3)
82
+ nokogiri (>= 1.5.9)
83
+ mail (2.6.5)
84
+ mime-types (>= 1.16, < 4)
85
+ method_source (0.8.2)
86
+ mime-types (3.1)
87
+ mime-types-data (~> 3.2015)
88
+ mime-types-data (3.2016.0521)
89
+ mini_portile2 (2.1.0)
90
+ minitest (5.10.1)
91
+ multi_json (1.12.1)
92
+ nio4r (2.0.0)
93
+ nokogiri (1.7.1)
94
+ mini_portile2 (~> 2.1.0)
95
+ pry (0.10.4)
96
+ coderay (~> 1.1.0)
97
+ method_source (~> 0.8.1)
98
+ slop (~> 3.4)
99
+ pry-rails (0.3.6)
100
+ pry (>= 0.10.4)
101
+ puma (3.8.2)
102
+ rack (2.0.1)
103
+ rack-test (0.6.3)
104
+ rack (>= 1.0)
105
+ rails (5.0.2)
106
+ actioncable (= 5.0.2)
107
+ actionmailer (= 5.0.2)
108
+ actionpack (= 5.0.2)
109
+ actionview (= 5.0.2)
110
+ activejob (= 5.0.2)
111
+ activemodel (= 5.0.2)
112
+ activerecord (= 5.0.2)
113
+ activesupport (= 5.0.2)
114
+ bundler (>= 1.3.0, < 2.0)
115
+ railties (= 5.0.2)
116
+ sprockets-rails (>= 2.0.0)
117
+ rails-assets-fastclick (0.6.11)
118
+ rails-assets-switchery (0.8.2)
119
+ rails-assets-fastclick (= 0.6.11)
120
+ rails-assets-transitionize
121
+ rails-assets-transitionize (0.0.3)
122
+ rails-dom-testing (2.0.2)
123
+ activesupport (>= 4.2.0, < 6.0)
124
+ nokogiri (~> 1.6)
125
+ rails-html-sanitizer (1.0.3)
126
+ loofah (~> 2.0)
127
+ railties (5.0.2)
128
+ actionpack (= 5.0.2)
129
+ activesupport (= 5.0.2)
130
+ method_source
131
+ rake (>= 0.8.7)
132
+ thor (>= 0.18.1, < 2.0)
133
+ rake (12.0.0)
134
+ rb-fsevent (0.9.8)
135
+ rb-inotify (0.9.8)
136
+ ffi (>= 0.5.0)
137
+ sass (3.4.23)
138
+ sass-rails (5.0.6)
139
+ railties (>= 4.0.0, < 6)
140
+ sass (~> 3.1)
141
+ sprockets (>= 2.8, < 4.0)
142
+ sprockets-rails (>= 2.0, < 4.0)
143
+ tilt (>= 1.1, < 3)
144
+ simple_form (3.4.0)
145
+ actionpack (> 4, < 5.1)
146
+ activemodel (> 4, < 5.1)
147
+ slop (3.6.0)
148
+ spring (2.0.1)
149
+ activesupport (>= 4.2)
150
+ spring-watcher-listen (2.0.1)
151
+ listen (>= 2.7, < 4.0)
152
+ spring (>= 1.2, < 3.0)
153
+ sprockets (3.7.1)
154
+ concurrent-ruby (~> 1.0)
155
+ rack (> 1, < 3)
156
+ sprockets-rails (3.2.0)
157
+ actionpack (>= 4.0)
158
+ activesupport (>= 4.0)
159
+ sprockets (>= 3.0.0)
160
+ sqlite3 (1.3.13)
161
+ thor (0.19.4)
162
+ thread_safe (0.3.6)
163
+ tilt (2.0.7)
164
+ turbolinks (5.0.1)
165
+ turbolinks-source (~> 5)
166
+ turbolinks-source (5.0.0)
167
+ tzinfo (1.2.3)
168
+ thread_safe (~> 0.1)
169
+ uglifier (3.2.0)
170
+ execjs (>= 0.3.0, < 3)
171
+ web-console (3.5.0)
172
+ actionview (>= 5.0)
173
+ activemodel (>= 5.0)
174
+ bindex (>= 0.4.0)
175
+ railties (>= 5.0)
176
+ websocket-driver (0.6.5)
177
+ websocket-extensions (>= 0.1.0)
178
+ websocket-extensions (0.1.2)
179
+
180
+ PLATFORMS
181
+ ruby
182
+
183
+ DEPENDENCIES
184
+ bootstrap-sass
185
+ byebug
186
+ coffee-rails (~> 4.2)
187
+ jbuilder (~> 2.5)
188
+ jquery-rails
189
+ listen (~> 3.0.5)
190
+ pry-rails
191
+ puma (~> 3.0)
192
+ rails (~> 5.0.2)
193
+ rails-assets-switchery!
194
+ sass-rails (~> 5.0)
195
+ simple_form
196
+ simple_form_custom_inputs!
197
+ spring
198
+ spring-watcher-listen (~> 2.0.0)
199
+ sqlite3
200
+ turbolinks (~> 5)
201
+ tzinfo-data
202
+ uglifier (>= 1.3.0)
203
+ web-console (>= 3.3.0)
204
+
205
+ BUNDLED WITH
206
+ 1.14.6
data/example/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
data/example/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css