foundation-formbuilder-rails 0.2.3 → 0.2.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 897f486913c350e8fcae686dcd8357eab2b12345
|
4
|
+
data.tar.gz: b868187bd38a00f0b3e979a52d3f719cb98374f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85b41f9bdd98f0b6ea39590a98b41363c0c643845c698957eca838d3be347b89d4c64c344afc3f40135f602331717532ad39502d707f7b69c361d7c49fbdc0ce
|
7
|
+
data.tar.gz: bdb3640ad35e9dddd57009f2f4533217844989cf78461f7cd2525646a34031fd2e88743fbb8fecc16aeb2163c4ccf1a6d71e263cb7a785824f559baa64a8e374
|
@@ -3,6 +3,7 @@ module Foundation
|
|
3
3
|
# module Rails
|
4
4
|
module Generators
|
5
5
|
class InstallGenerator < ::Rails::Generators::Base
|
6
|
+
desc "This generator creates an initializer file at config/initializers/global_formbuilder.rb"
|
6
7
|
source_root File.join(File.dirname(__FILE__), '..', 'templates')
|
7
8
|
|
8
9
|
def add_initialiser
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foundation-formbuilder-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ashley Bye
|
@@ -24,121 +24,8 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.6'
|
27
|
-
description:
|
28
|
-
|
29
|
-
|
30
|
-
This is a custom FormBuilder used to display form elements generated
|
31
|
-
by the `form_for` helpers in the correct style for
|
32
|
-
the [*Foundation 5 Framework*](http://foundation.zurb.com/).
|
33
|
-
|
34
|
-
|
35
|
-
See the Foundation [docs](http://foundation.zurb.com/docs/components/forms.html)
|
36
|
-
for form specifics.
|
37
|
-
|
38
|
-
## Getting Started
|
39
|
-
|
40
|
-
1. Add the `foundation-formbuilder-rails` Gem to your project's `Gemfile`:
|
41
|
-
|
42
|
-
gem 'foundation-formbuilder-rails'
|
43
|
-
|
44
|
-
2. Ensure you are using the FormBuilder in your form:
|
45
|
-
|
46
|
-
form_for @test, builder: Foundation::FormBuilder::Rails::FormBuilder do |f|
|
47
|
-
...
|
48
|
-
end
|
49
|
-
|
50
|
-
3. Alternatively, you can set the FormBuilder globally in an initializer,
|
51
|
-
`ActionView::Base.default_form_builder = Foundation::FormBuilder::Rails::FormBuilder`.
|
52
|
-
|
53
|
-
4. This can be achieved by running:
|
54
|
-
|
55
|
-
rails generate foundation:form_builder:install
|
56
|
-
|
57
|
-
5. Be sure to restart your application once this has been done. Then you only need:
|
58
|
-
|
59
|
-
form_for @test do |f|
|
60
|
-
|
61
|
-
6. For usage, see comments in the [source code](https://github.com/ashleybye/foundation-formbuilder-rails/blob/master/lib/foundation/form_builder/rails/form_builder.rb). I will get around to adding proper use examples to the README in the future. However, as a quick reference, the original Rails methods will
|
62
|
-
still return the standard content but prefix with `zurb_` and it will return the content formatted
|
63
|
-
for Foundation:
|
64
|
-
|
65
|
-
form_for @test do |f|
|
66
|
-
f.zurb_text_field :name
|
67
|
-
end
|
68
|
-
# => <form accept-charset="UTF-8" action="/test" class="new_test" id="new_test" method="post">
|
69
|
-
<div style="display:none">
|
70
|
-
<input name="utf8" type="hidden" value="✓" />
|
71
|
-
<input name="authenticity_token" type="hidden" value="ofJbUSioJ9w+c6EkPy993jtBskYMK/97gp667ACWZDI=" />
|
72
|
-
</div>
|
73
|
-
<label for="test">Name
|
74
|
-
<input id="message_name" name="test[name]" type="text" />
|
75
|
-
</label>
|
76
|
-
</form>
|
77
|
-
|
78
|
-
## Complete
|
79
|
-
|
80
|
-
I have completed the builder for all of the Rails FormBuilder and FormOptionsHelper
|
81
|
-
methods. I have also included some Foundation specific methods, but I may remove these
|
82
|
-
before the final release.
|
83
|
-
|
84
|
-
### FormHelper
|
85
|
-
|
86
|
-
`check_box`
|
87
|
-
`color_field`
|
88
|
-
`date_field`
|
89
|
-
`datetime_field`
|
90
|
-
`datetime_local_field`
|
91
|
-
`email_field`
|
92
|
-
`file_field`
|
93
|
-
`month_field`
|
94
|
-
`number_field`
|
95
|
-
`password_field`
|
96
|
-
`phone_field`
|
97
|
-
`radio_button`
|
98
|
-
`range_field`
|
99
|
-
`search_field`
|
100
|
-
`telephone_field`
|
101
|
-
`time_field`
|
102
|
-
`text_field`
|
103
|
-
`text_area`
|
104
|
-
`url_field`
|
105
|
-
`week_field`
|
106
|
-
|
107
|
-
### FormOptionsHelper
|
108
|
-
|
109
|
-
`collection_check_boxes`
|
110
|
-
`collection_radio_buttons`
|
111
|
-
`collection_select`
|
112
|
-
`grouped_collection_select`
|
113
|
-
`select`
|
114
|
-
`time_zone_select`
|
115
|
-
|
116
|
-
### Foundation Specific
|
117
|
-
|
118
|
-
`check_box_group`
|
119
|
-
`radio_button_group`
|
120
|
-
|
121
|
-
(May be removed at a later stage)
|
122
|
-
|
123
|
-
## Development
|
124
|
-
|
125
|
-
This project is still under development, although the main functionality works. I am still deciding
|
126
|
-
whether to keep the `zurb_` prefix plus the ability to produce field tags that are not wrapped in a
|
127
|
-
label.
|
128
|
-
|
129
|
-
If you wish to contribute please contact me.
|
130
|
-
|
131
|
-
### Possibilities
|
132
|
-
|
133
|
-
I am still deciding whether it is worth writing builder methods to provide the following:
|
134
|
-
|
135
|
-
`Pre/Postfix labels (Foundation)`
|
136
|
-
`Switches (Foundation)`
|
137
|
-
`Abide Validation (Foundaation)`
|
138
|
-
|
139
|
-
## Issues
|
140
|
-
|
141
|
-
If you notice any problems with this Gem please file an [issue](https://github.com/ashleybye/foundation-formbuilder-rails/issues).
|
27
|
+
description: This is a custom FormBuilder used to display form elements generated
|
28
|
+
by the `form_for` helpers in the correct style for the Foundation 5 Framework (http://foundation.zurb.com/)
|
142
29
|
email:
|
143
30
|
- ashley.bye85@gmail.com
|
144
31
|
executables: []
|
@@ -157,8 +44,10 @@ files:
|
|
157
44
|
homepage: https://github.com/ashleybye/foundation-formbuilder-rails
|
158
45
|
licenses:
|
159
46
|
- MIT
|
160
|
-
metadata:
|
161
|
-
|
47
|
+
metadata:
|
48
|
+
issue_tracker: https://github.com/ashleybye/foundation-formbuilder-rails/issues
|
49
|
+
post_install_message: Run `rails g foundation:form_builder:install [--help]` to add
|
50
|
+
the FormBuilder to your project globally
|
162
51
|
rdoc_options: []
|
163
52
|
require_paths:
|
164
53
|
- lib
|