materialize-form 1.0.2 → 1.0.3
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/LICENSE.txt +22 -0
- data/README.md +36 -33
- data/lib/materialize/form/version.rb +1 -1
- data/materialize-form-1.0.2.gem +0 -0
- data/materialize-form.gemspec +2 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74ee9d90ad894bce3088a65402c377613aff1710
|
4
|
+
data.tar.gz: 838af73f486f60e619fe3c84a9c8a37e7bc91702
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68e8fd0045207a332d5df1e1905c9751438353eec9e38f452dca4d0eaf908e4a40a13225a39ea819ec713c57fd5d2ed40897c59bf6b87115e6d2e13f962fd3db
|
7
|
+
data.tar.gz: 890a98fa3540df88937fbe79b748ea82f4e13f4e9bc49a0ae4e81a1004e50665f348fc938ef74d40287c442b1f8ed50603b2d8a025fa54271093d390d43adba7
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2016 TODO: James La
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -2,33 +2,47 @@
|
|
2
2
|
|
3
3
|
This is a generator gem for [SimpleForm](https://github.com/plataformatec/simple_form) to make it works with [MaterializeCSS](http://materializecss.com/).
|
4
4
|
|
5
|
-
There is an example application available on Heroku that demonstrate various features of Materialize::Form. You can view
|
5
|
+
There is an example application available on Heroku that demonstrate various features of Materialize::Form. You can view here: http://materialize-form.herokuapp.com/. To see the [Source Code](https://github.com/jamesfwz/materialize-form-example)
|
6
6
|
|
7
|
-
|
7
|
+
Haven't install [SimpleForm](https://github.com/plataformatec/simple_form) and [MaterializeCSS](http://materializecss.com/)? Please follow this instruction:
|
8
8
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
|
+
``` ruby
|
11
|
+
gem 'simple_form'
|
12
|
+
gem 'materialize-sass'
|
13
|
+
```
|
14
|
+
```console
|
15
|
+
$ bundle install
|
16
|
+
rails generate simple_form:install
|
17
|
+
```
|
18
|
+
Import Materialize styles in app/assets/stylesheets/application.scss:
|
19
|
+
```scss
|
20
|
+
@import "materialize";
|
21
|
+
```
|
22
|
+
**NOTE:** If you have just generated a new Rails application, it may come with a `.css` file instead. If this file exists, it will be served instead of Sass, so remove it.
|
10
23
|
|
24
|
+
```console
|
25
|
+
$ rm app/assets/stylesheets/application.css
|
26
|
+
```
|
27
|
+
|
28
|
+
## Installation
|
29
|
+
|
30
|
+
### Step 1:
|
31
|
+
Add this line to your application's Gemfile:
|
11
32
|
```ruby
|
12
|
-
gem 'simple_form', "~> 3.2.1"
|
13
|
-
gem 'materialize-sass', "~> 0.97.6"
|
14
33
|
gem 'materialize-form'
|
15
34
|
```
|
16
35
|
|
17
|
-
|
36
|
+
### Step 2:
|
37
|
+
Run the bundler and restart your server to make the files available through the pipeline and run the generator
|
18
38
|
```console
|
19
39
|
$ bundle install
|
20
|
-
```
|
21
|
-
|
22
|
-
Run the generator:
|
23
|
-
```console
|
24
40
|
$ rails generate simple_form:materialize:install
|
25
41
|
```
|
26
42
|
|
43
|
+
### Step 3:
|
27
44
|
Import Materialize Form javascript in `app/assets/javascripts/application.js`:
|
28
|
-
|
29
45
|
```js
|
30
|
-
//= require jquery
|
31
|
-
//= require materialize-sprockets
|
32
46
|
//= require materialize-form
|
33
47
|
|
34
48
|
$(document).ready(function() {
|
@@ -36,18 +50,6 @@ $(document).ready(function() {
|
|
36
50
|
});
|
37
51
|
```
|
38
52
|
|
39
|
-
Import Materialize styles in `app/assets/stylesheets/application.scss`:
|
40
|
-
|
41
|
-
```scss
|
42
|
-
@import "materialize";
|
43
|
-
```
|
44
|
-
|
45
|
-
**NOTE:** If you have just generated a new Rails application, it may come with a `.css` file instead. If this file exists, it will be served instead of Sass, so remove it.
|
46
|
-
|
47
|
-
```console
|
48
|
-
$ rm app/assets/stylesheets/application.css
|
49
|
-
```
|
50
|
-
|
51
53
|
## Usage
|
52
54
|
### Assume you are using SLIM
|
53
55
|
|
@@ -56,7 +58,8 @@ To start using Materialize Form you just have to use the helper it provides:
|
|
56
58
|
```slim
|
57
59
|
= simple_form_for @user do |f|
|
58
60
|
.row
|
59
|
-
= f.input :
|
61
|
+
= f.input :first_name, wrapper_html: { class: 'm6 s12' }
|
62
|
+
= f.input :last_name, wrapper_html: { class: 'm6 s12' }
|
60
63
|
|
61
64
|
= f.button :submit
|
62
65
|
```
|
@@ -64,7 +67,7 @@ To start using Materialize Form you just have to use the helper it provides:
|
|
64
67
|
#### Selectbox
|
65
68
|
|
66
69
|
```slim
|
67
|
-
|
70
|
+
= f.association :country, include_blank: 'What are your country?', wrapper_html: { class: 'm6 s12' }
|
68
71
|
```
|
69
72
|
|
70
73
|
#### File Input
|
@@ -72,7 +75,7 @@ To start using Materialize Form you just have to use the helper it provides:
|
|
72
75
|
File input will be generated automatically if the type of the field is attachment.
|
73
76
|
|
74
77
|
```slim
|
75
|
-
|
78
|
+
= f.input :avatar, wrapper_html: { class: 'm6 s12' }
|
76
79
|
```
|
77
80
|
|
78
81
|
#### Date Input
|
@@ -80,32 +83,32 @@ File input will be generated automatically if the type of the field is attachmen
|
|
80
83
|
Date picker will be generated automatically if the type of the field is date.
|
81
84
|
|
82
85
|
```slim
|
83
|
-
|
86
|
+
= f.input :dob, wrapper_html: { class: 'm6 s12' }
|
84
87
|
```
|
85
88
|
|
86
89
|
#### Checkboxes
|
87
90
|
```slim
|
88
|
-
|
91
|
+
= f.association :hobbies, as: :check_boxes, wrapper_html: { class: 'm6 s12' }
|
89
92
|
```
|
90
93
|
|
91
94
|
#### Multi-Selectbox
|
92
95
|
```slim
|
93
|
-
|
96
|
+
= f.association :hobbies, include_blank: 'What are your hobbies?', wrapper_html: { class: 'm6 s12' }
|
94
97
|
```
|
95
98
|
|
96
99
|
#### Toggle Boolean
|
97
100
|
```slim
|
98
|
-
|
101
|
+
= f.input :featured, wrapper_html: { class: 'm6 s12' }
|
99
102
|
```
|
100
103
|
|
101
104
|
#### Boolean
|
102
105
|
```slim
|
103
|
-
|
106
|
+
= f.input :featured, wrapper: :materialize_boolean, wrapper_html: { class: 'm6 s12 ' }
|
104
107
|
```
|
105
108
|
|
106
109
|
#### Radio Buttons
|
107
110
|
```slim
|
108
|
-
|
111
|
+
= f.input :featured, as: :radio_buttons, wrapper_html: { class: 'm6 s12' }
|
109
112
|
```
|
110
113
|
|
111
114
|
## Working with [Nested Form](https://github.com/ryanb/nested_form)
|
Binary file
|
data/materialize-form.gemspec
CHANGED
@@ -8,8 +8,9 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Materialize::Form::VERSION
|
9
9
|
spec.authors = ["James La"]
|
10
10
|
spec.email = ["jamesla0604@gmail.com"]
|
11
|
+
spec.license = "MIT"
|
11
12
|
|
12
|
-
spec.summary = "Materialize
|
13
|
+
spec.summary = "Materialize - SimpleForm Generator."
|
13
14
|
spec.description = "This gem includes a generator for SimpleForm configuration with Materialize. It also includes custom inputs for materialize."
|
14
15
|
spec.homepage = "http://materialize-form.herokuapp.com/users/new"
|
15
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: materialize-form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James La
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- ".travis.yml"
|
64
64
|
- CODE_OF_CONDUCT.md
|
65
65
|
- Gemfile
|
66
|
+
- LICENSE.txt
|
66
67
|
- README.md
|
67
68
|
- Rakefile
|
68
69
|
- app/assets/javascripts/materialize-form.js
|
@@ -78,9 +79,11 @@ files:
|
|
78
79
|
- lib/materialize/form/version.rb
|
79
80
|
- materialize-form-1.0.0.gem
|
80
81
|
- materialize-form-1.0.1.gem
|
82
|
+
- materialize-form-1.0.2.gem
|
81
83
|
- materialize-form.gemspec
|
82
84
|
homepage: http://materialize-form.herokuapp.com/users/new
|
83
|
-
licenses:
|
85
|
+
licenses:
|
86
|
+
- MIT
|
84
87
|
metadata: {}
|
85
88
|
post_install_message:
|
86
89
|
rdoc_options: []
|
@@ -101,5 +104,5 @@ rubyforge_project:
|
|
101
104
|
rubygems_version: 2.6.4
|
102
105
|
signing_key:
|
103
106
|
specification_version: 4
|
104
|
-
summary: Materialize
|
107
|
+
summary: Materialize - SimpleForm Generator.
|
105
108
|
test_files: []
|