forme 0.9.0 → 0.9.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 +4 -0
- data/README.rdoc +4 -0
- data/lib/forme/version.rb +1 -1
- data/lib/sequel/plugins/forme.rb +1 -1
- data/spec/sequel_plugin_spec.rb +5 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b45369402c9a718a22afc64018b0063082647065
|
4
|
+
data.tar.gz: 1a91e0227fd23138ef2f71842c81648d73fd6400
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02650bc7eee1eed4d3b562a52204b936dabf70d1f726ad1660a2ead235ad74708503b035b4301c983bc946516485bb207bb769becd09290b95016004e11d4ffe
|
7
|
+
data.tar.gz: 03d3c5db265495a2795bddfe9e656ac1e6b84b83e211951cffaf28607a6ca3970812bc7f107beb4a1e44f219657508c83878fe5b340874ea2a93f56dab94655f
|
data/CHANGELOG
CHANGED
data/README.rdoc
CHANGED
@@ -7,6 +7,10 @@ Forme is a HTML forms library for ruby with the following goals:
|
|
7
7
|
3. Support forms both with and without related objects
|
8
8
|
4. Allow compiling down to different types of output
|
9
9
|
|
10
|
+
= Installation
|
11
|
+
|
12
|
+
sudo gem install forme
|
13
|
+
|
10
14
|
= Demo Site
|
11
15
|
|
12
16
|
A demo site is available at http://forme-demo.jeremyevans.net
|
data/lib/forme/version.rb
CHANGED
data/lib/sequel/plugins/forme.rb
CHANGED
@@ -380,7 +380,7 @@ module Sequel # :nodoc:
|
|
380
380
|
# as :as=>:radio, or :as=>:checkbox to specify a particular style.
|
381
381
|
def input_boolean(sch)
|
382
382
|
unless opts.has_key?(:as)
|
383
|
-
opts[:as] = sch[:allow_null] ? :select : :checkbox
|
383
|
+
opts[:as] = (sch[:allow_null] || opts[:required] == false) ? :select : :checkbox
|
384
384
|
end
|
385
385
|
|
386
386
|
case opts[:as]
|
data/spec/sequel_plugin_spec.rb
CHANGED
@@ -90,6 +90,11 @@ describe "Forme Sequel::Model forms" do
|
|
90
90
|
@b.input(:gold, :true_value=>"Foo", :false_value=>"Bar").to_s.should == '<label>Gold: <select id="album_gold" name="album[gold]"><option value=""></option><option value="Foo">True</option><option value="Bar">False</option></select></label>'
|
91
91
|
end
|
92
92
|
|
93
|
+
specify "should use a select box for dual-valued boolean fields where :required => false" do
|
94
|
+
@b.input(:platinum, :required=>false).to_s.should == '<label>Platinum: <select id="album_platinum" name="album[platinum]"><option value=""></option><option value="t">True</option><option selected="selected" value="f">False</option></select></label>'
|
95
|
+
@c.input(:platinum, :required=>false).to_s.should == '<label>Platinum: <select id="album_platinum" name="album[platinum]"><option value=""></option><option selected="selected" value="t">True</option><option value="f">False</option></select></label>'
|
96
|
+
end
|
97
|
+
|
93
98
|
specify "should use a checkbox for dual-valued boolean fields" do
|
94
99
|
@b.input(:platinum).to_s.should == '<input id="album_platinum_hidden" name="album[platinum]" type="hidden" value="f"/><label><input id="album_platinum" name="album[platinum]" type="checkbox" value="t"/> Platinum</label>'
|
95
100
|
@c.input(:platinum).to_s.should == '<input id="album_platinum_hidden" name="album[platinum]" type="hidden" value="f"/><label><input checked="checked" id="album_platinum" name="album[platinum]" type="checkbox" value="t"/> Platinum</label>'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Evans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
Forme is a forms library with the following goals:
|
@@ -41,7 +41,8 @@ files:
|
|
41
41
|
- lib/forme/version.rb
|
42
42
|
- lib/sequel/plugins/forme.rb
|
43
43
|
homepage: http://gihub.com/jeremyevans/forme
|
44
|
-
licenses:
|
44
|
+
licenses:
|
45
|
+
- MIT
|
45
46
|
metadata: {}
|
46
47
|
post_install_message:
|
47
48
|
rdoc_options:
|
@@ -66,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
67
|
version: '0'
|
67
68
|
requirements: []
|
68
69
|
rubyforge_project:
|
69
|
-
rubygems_version: 2.0.
|
70
|
+
rubygems_version: 2.0.14
|
70
71
|
signing_key:
|
71
72
|
specification_version: 4
|
72
73
|
summary: HTML forms library
|