formular 0.2.0 → 0.2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +35 -47
- data/formular.gemspec +0 -2
- data/lib/formular/element/module.rb +2 -2
- data/lib/formular/version.rb +1 -1
- metadata +3 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0a80c5927dbbece4b4e9a888d51497a4b03fb4d
|
4
|
+
data.tar.gz: 0598fe40cccca15f3e0542c5b77a47a89907e5f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baa976452c932d62cb3fc78ef2db818016695abb6e2a6b8084c24c42592a702ab39fd86fc2f0fed26b70bb28a03dfcaf9dae71c08618583c230121defb047fb0
|
7
|
+
data.tar.gz: bd365b3219770eaf4628cea94447ff9cb596b9aca07fb5f30b89a0f5d9f5ab92ce30844934e975250136afd31e0b0a3860a506df1dd947e2cade309288223d12
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -13,7 +13,7 @@ Formular renders HTML forms in a similar fashion to [SimpleForm](https://github.
|
|
13
13
|
|
14
14
|
## Example
|
15
15
|
|
16
|
-
While you can instantiate the form builder manually, it's easiest to use the `form` helper to do so. Include `Formular::Helper` into your cell, view, or in a Rails controller as a helper.
|
16
|
+
While you can instantiate the form builder manually, it's easiest to use the `form` helper to do so. Include `Formular::Helper` or in rails, `Formular::RailsHelper` into your cell, view, or in a Rails controller as a helper.
|
17
17
|
|
18
18
|
```ruby
|
19
19
|
module Post::Cell
|
@@ -25,7 +25,7 @@ or
|
|
25
25
|
|
26
26
|
```ruby
|
27
27
|
class PostsController < ApplicationController
|
28
|
-
helper Formular::
|
28
|
+
helper Formular::RailsHelper
|
29
29
|
```
|
30
30
|
|
31
31
|
You should also configure what builder you want to use. This will wrap inputs correctly, and so on.
|
@@ -36,59 +36,47 @@ Formular::Helper.builder= :bootstrap3
|
|
36
36
|
|
37
37
|
In your view, you're now ready to use Formular's API to render forms.
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
Formular's API docs and information on how to extend it can be found on the [Trailblazer project page](http://trailblazer.to/gems/formular).
|
70
|
-
|
71
|
-
Formular's rendering is easily customizable. It provides built-in support for Foundation 6, Bootstrap 3 and Bootstrap 4 so far with more to come.
|
72
|
-
|
73
|
-
The list of builders provided by default can be seen in the BUILDERS constant. Try the following in an IRB session with your project loaded (rails console).
|
74
|
-
|
75
|
-
```ruby
|
76
|
-
Formular::Helper::BUILDERS
|
77
|
-
```
|
78
|
-
|
79
|
-
|
39
|
+
Our basic builder ships with the following elements:
|
40
|
+
* error_notification
|
41
|
+
* form
|
42
|
+
* fieldset
|
43
|
+
* legend
|
44
|
+
* div
|
45
|
+
* span
|
46
|
+
* p
|
47
|
+
* input
|
48
|
+
* hidden
|
49
|
+
* label
|
50
|
+
* error
|
51
|
+
* hint
|
52
|
+
* textarea
|
53
|
+
* submit
|
54
|
+
* select
|
55
|
+
* checkbox
|
56
|
+
* radio
|
57
|
+
* wrapper
|
58
|
+
* error_wrapper
|
59
|
+
|
60
|
+
We also provide builders for Twitter Bootstrap (v.3&4) and Zurb's Foundation (v.6)
|
61
|
+
|
62
|
+
To help you get started we've got some example Sinatra apps so you can see Formular in action:
|
63
|
+
[Bootstrap3 (slim)](https://github.com/fran-worley/gemgem-sinatra/tree/formular-slim-bootstrap3)
|
64
|
+
[Bootstrap4 (slim)](https://github.com/fran-worley/gemgem-sinatra/tree/formular-slim-bootstrap4)
|
65
|
+
Foundation6 (slim)
|
66
|
+
|
67
|
+
Formular's API docs and information on how to extend it will be found on the [Trailblazer project page](http://trailblazer.to/gems/formular) once the page has been added 😉.
|
80
68
|
|
81
69
|
## Key Features
|
82
70
|
|
83
71
|
* Incredibly fast.
|
84
|
-
* Customization: "Wrappers" are self-explaining objects. Ships with renderers for Foundation
|
85
|
-
* No magic
|
72
|
+
* Customization: "Wrappers" are self-explaining objects. Ships with renderers for Foundation 6 and Bootstrap 3&4
|
73
|
+
* No magic, no guessing, no hidden semantics.
|
86
74
|
* A well-designed API instead of a configuration DSL. If you need to change behavior, program it.
|
87
75
|
|
88
76
|
## Limitations
|
89
77
|
|
90
78
|
* Currently, nested hashes aren't suffixed with `_attributes`, as it's usually done in ActiveRecord.
|
91
|
-
* Capturing only works with Slim and Hamlit. A 'blockless' API is provided to enable use in ERB
|
79
|
+
* Capturing only works with Slim and Hamlit. A 'blockless' API is provided to enable use in ERB but watch this space as improvements are coming for ERB
|
92
80
|
|
93
81
|
## Installation
|
94
82
|
|
@@ -98,7 +86,7 @@ Add this line to your application's Gemfile:
|
|
98
86
|
gem 'formular'
|
99
87
|
```
|
100
88
|
|
101
|
-
Requires Ruby >= 2.
|
89
|
+
Requires Ruby >= 2.0.0
|
102
90
|
|
103
91
|
## License
|
104
92
|
|
data/formular.gemspec
CHANGED
@@ -23,8 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
-
spec.add_development_dependency "reform"
|
27
|
-
spec.add_development_dependency "dry-validation"
|
28
26
|
spec.add_development_dependency "trailblazer-cells"
|
29
27
|
spec.add_development_dependency "cells-slim"
|
30
28
|
spec.add_development_dependency "cells-erb"
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Include this in every module that gets further included.
|
2
2
|
# This is literally a copy and past from reform. Could we dry this up ??
|
3
3
|
# https://github.com/apotonick/reform/blob/master/lib/reform/form/module.rb
|
4
|
-
|
5
|
-
|
4
|
+
require 'declarative'
|
5
|
+
require 'declarative/heritage'
|
6
6
|
module Formular
|
7
7
|
class Element
|
8
8
|
module Module
|
data/lib/formular/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-09-
|
12
|
+
date: 2016-09-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: declarative
|
@@ -67,34 +67,6 @@ dependencies:
|
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '10.0'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: reform
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
77
|
-
type: :development
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '0'
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: dry-validation
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - ">="
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '0'
|
91
|
-
type: :development
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - ">="
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: '0'
|
98
70
|
- !ruby/object:Gem::Dependency
|
99
71
|
name: trailblazer-cells
|
100
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
212
|
version: '0'
|
241
213
|
requirements: []
|
242
214
|
rubyforge_project:
|
243
|
-
rubygems_version: 2.
|
215
|
+
rubygems_version: 2.4.6
|
244
216
|
signing_key:
|
245
217
|
specification_version: 4
|
246
218
|
summary: Form builder based on Cells. Fast, Furious, and Framework-Agnostic.
|