effective_form_inputs 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/README.md +81 -28
- data/lib/effective_form_inputs/version.rb +1 -1
- data/lib/effective_form_inputs.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfb139ee0ac3bdd08159e9eb79359d31bad07c27
|
4
|
+
data.tar.gz: 38c3ea428c5d9c184f8a7bc143705b3b6eb5e581
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb0cb297acd58a2d45024bb5906cec6825261bbaefdc6aea4b3030c9c84617db288f51c8d408d8ec9de2818f1ff4492c108e8725add0d6e4aea2f457a9ef2a65
|
7
|
+
data.tar.gz: d9254902a855f0abf74936cdbbd26338386b0216f748b42ef1537b706b15e261437b32cbb694eb65205c2fa8449ded1e071c29781a829b107f98008cf6149d3e
|
data/README.md
CHANGED
@@ -1,65 +1,118 @@
|
|
1
1
|
# Effective Form Inputs
|
2
2
|
|
3
|
-
|
3
|
+
Multiple custom Rails Form Helper and SimpleForm inputs in one Rails engine.
|
4
4
|
|
5
|
-
|
5
|
+
This gem contains numerous custom form inputs along with their Javascript/CSS assets.
|
6
6
|
|
7
|
-
Each form input
|
7
|
+
Each included form input is available to both the default Rails Form Helper and SimpleForm.
|
8
8
|
|
9
|
-
|
9
|
+
Rails 3.2.x and 4.x
|
10
10
|
|
11
|
-
|
11
|
+
Right now there's just one form input. This will grow.
|
12
12
|
|
13
|
-
|
13
|
+
## Getting Started
|
14
14
|
|
15
|
-
|
15
|
+
Add to your Gemfile:
|
16
16
|
|
17
|
-
|
17
|
+
```ruby
|
18
|
+
gem 'effective_form_inputs'
|
19
|
+
```
|
20
|
+
|
21
|
+
Run the bundle command to install it:
|
22
|
+
|
23
|
+
```console
|
24
|
+
bundle install
|
25
|
+
```
|
26
|
+
|
27
|
+
### Install All Form Inputs
|
18
28
|
|
29
|
+
This gem packages the javascript/css assets for numerous form inputs.
|
30
|
+
|
31
|
+
The assets for these inputs may be included all at once or individually.
|
32
|
+
|
33
|
+
To install all available inputs, add the following to your application.js:
|
34
|
+
|
35
|
+
```ruby
|
19
36
|
//= require effective_form_inputs
|
20
|
-
|
37
|
+
```
|
21
38
|
|
22
|
-
|
39
|
+
and add the following to your application.css:
|
23
40
|
|
24
|
-
|
25
|
-
|
41
|
+
```ruby
|
42
|
+
*= require effective_form_inputs
|
43
|
+
```
|
26
44
|
|
27
|
-
|
45
|
+
All of the included form inputs will now be available with no additional installation tasks.
|
28
46
|
|
29
|
-
https://github.com/Eonasdan/bootstrap-datetimepicker
|
30
47
|
|
31
|
-
|
48
|
+
## Bootstrap3 DateTimePicker
|
32
49
|
|
33
|
-
|
50
|
+
This custom form input is based on the following awesome project:
|
34
51
|
|
35
|
-
|
52
|
+
Bootstrap 3 Datepicker (https://github.com/Eonasdan/bootstrap-datetimepicker)
|
36
53
|
|
37
|
-
= f.input :updated_at, :as => :effective_date_time_picker
|
38
54
|
|
39
|
-
|
55
|
+
### Installation
|
40
56
|
|
41
|
-
|
57
|
+
If you've already installed the 'All Form Inputs' assets (see above), there are no additional installation steps.
|
42
58
|
|
43
|
-
|
59
|
+
To install this form input individually, add the following to your application.js:
|
44
60
|
|
45
|
-
|
61
|
+
```ruby
|
62
|
+
//= require effective_date_time_picker/input
|
63
|
+
```
|
46
64
|
|
47
|
-
|
65
|
+
and add the following to your application.css:
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
*= require effective_date_time_picker/input
|
69
|
+
```
|
48
70
|
|
71
|
+
### Usage
|
49
72
|
|
50
|
-
|
73
|
+
As a Rails Form Helper input:
|
51
74
|
|
75
|
+
```ruby
|
76
|
+
= form_for @user do |f|
|
77
|
+
= f.effective_date_time_picker :updated_at
|
78
|
+
```
|
52
79
|
|
53
|
-
|
80
|
+
and as a SimpleForm input:
|
54
81
|
|
55
|
-
|
82
|
+
```ruby
|
83
|
+
= simple_form_for @user do |f|
|
84
|
+
= f.input :updated_at, :as => :effective_date_time_picker
|
85
|
+
```
|
56
86
|
|
57
|
-
|
87
|
+
### Passing Options to JavaScript
|
88
|
+
|
89
|
+
Any options passed to the form input will be used to initialize the Bootstrap3 DateTimePicker
|
90
|
+
|
91
|
+
For example (and this works just the same with the SimpleForm input):
|
58
92
|
|
59
93
|
```ruby
|
60
|
-
|
94
|
+
= form_for @user do |f|
|
95
|
+
= f.effective_date_time_picker :updated_at, :format => 'YYYY-MM-DD', :showTodayButton => true
|
61
96
|
```
|
62
97
|
|
98
|
+
For a full list of options, please refer to:
|
99
|
+
|
100
|
+
http://eonasdan.github.io/bootstrap-datetimepicker/Options/
|
101
|
+
|
102
|
+
|
103
|
+
## License
|
104
|
+
|
105
|
+
MIT License. Copyright [Code and Effect Inc.](http://www.codeandeffect.com/)
|
106
|
+
|
107
|
+
Code and Effect is the product arm of [AgileStyle](http://www.agilestyle.com/), an Edmonton-based shop that specializes in building custom web applications with Ruby on Rails.
|
108
|
+
|
109
|
+
|
110
|
+
## Credits
|
111
|
+
|
112
|
+
The authors of this gem are not associated with any of the awesome projects used in this gem.
|
113
|
+
|
114
|
+
We are just extending these existing community projects for ease of use with Rails Form Helper and SimpleForm
|
115
|
+
|
63
116
|
|
64
117
|
## Contributing
|
65
118
|
|
@@ -3,5 +3,5 @@ require "effective_form_inputs/engine"
|
|
3
3
|
require "effective_form_inputs/version"
|
4
4
|
|
5
5
|
module EffectiveFormInputs
|
6
|
-
REJECTED_INPUT_JS_OPTIONS = [:as, :hint, :error, :readonly, :disabled, :required, :label, :inline_label, :placeholder, :prompt, :min_max, :maxlength, :pattern, :input_html, :wrapper_html, :error_html, :id, :wrapper, :collection]
|
6
|
+
REJECTED_INPUT_JS_OPTIONS = [:as, :hint, :error, :readonly, :disabled, :required, :label, :inline_label, :placeholder, :prompt, :min_max, :maxlength, :pattern, :input_html, :wrapper_html, :error_html, :id, :wrapper, :collection, :include_blank]
|
7
7
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_form_inputs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|