formtastic 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.textile +1 -1
  2. data/lib/formtastic.rb +10 -0
  3. metadata +68 -132
data/README.textile CHANGED
@@ -88,7 +88,7 @@ Formtastic is now compatible with both Rails 2 and Rails 3, and the gem is "host
88
88
  Simply add Formtastic to your Gemfile and bundle it up:
89
89
 
90
90
  <pre>
91
- gem 'formtastic', '~> 1.1.0'
91
+ gem 'formtastic', '~> 1.2.5'
92
92
  </pre>
93
93
 
94
94
  Optionally, run the generator to copy some stylesheets and a configuration initializer into your application:
data/lib/formtastic.rb CHANGED
@@ -843,11 +843,21 @@ module Formtastic #:nodoc:
843
843
  select(input_name, collection, strip_formtastic_options(options), html_options)
844
844
  end
845
845
 
846
+ if html_options[:multiple]
847
+ select_html = create_hidden_field_for_multiple_select(input_name) << select_html
848
+ end
849
+
846
850
  label_options = options_for_label(options).merge(:input_name => input_name)
847
851
  label_options[:for] ||= html_options[:id]
848
852
  label(method, label_options) << select_html
849
853
  end
850
854
 
855
+ # Outputs a custom hidden field for multiple selects
856
+ def create_hidden_field_for_multiple_select(method) #:nodoc:
857
+ input_name = "#{object_name}[#{method.to_s}][]"
858
+ template.hidden_field_tag(input_name, '')
859
+ end
860
+
851
861
  # Outputs a timezone select input as Rails' time_zone_select helper. You
852
862
  # can give priority zones as option.
853
863
  #
metadata CHANGED
@@ -1,143 +1,79 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: formtastic
3
- version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 2
9
- - 4
10
- version: 1.2.4
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.5
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Justin French
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-06-01 00:00:00 +10:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: activesupport
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 13
30
- segments:
31
- - 2
32
- - 3
33
- - 7
34
- version: 2.3.7
35
- type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: actionpack
39
- prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 13
46
- segments:
47
- - 2
48
- - 3
49
- - 7
50
- version: 2.3.7
51
- type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
12
+ date: 2011-06-01 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
54
15
  name: i18n
55
- prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
16
+ requirement: &70356084608560 !ruby/object:Gem::Requirement
57
17
  none: false
58
- requirements:
18
+ requirements:
59
19
  - - ~>
60
- - !ruby/object:Gem::Version
61
- hash: 3
62
- segments:
63
- - 0
64
- - 4
65
- version: "0.4"
20
+ - !ruby/object:Gem::Version
21
+ version: 0.4.0
66
22
  type: :runtime
67
- version_requirements: *id003
68
- - !ruby/object:Gem::Dependency
69
- name: rails
70
23
  prerelease: false
71
- requirement: &id004 !ruby/object:Gem::Requirement
24
+ version_requirements: *70356084608560
25
+ - !ruby/object:Gem::Dependency
26
+ name: rails
27
+ requirement: &70356084608060 !ruby/object:Gem::Requirement
72
28
  none: false
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- hash: 7
77
- segments:
78
- - 3
79
- - 0
80
- - 0
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
81
32
  version: 3.0.0
82
33
  type: :development
83
- version_requirements: *id004
84
- - !ruby/object:Gem::Dependency
85
- name: rspec-rails
86
34
  prerelease: false
87
- requirement: &id005 !ruby/object:Gem::Requirement
35
+ version_requirements: *70356084608060
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec-rails
38
+ requirement: &70356084607580 !ruby/object:Gem::Requirement
88
39
  none: false
89
- requirements:
40
+ requirements:
90
41
  - - ~>
91
- - !ruby/object:Gem::Version
92
- hash: 15
93
- segments:
94
- - 2
95
- - 0
96
- - 0
42
+ - !ruby/object:Gem::Version
97
43
  version: 2.0.0
98
44
  type: :development
99
- version_requirements: *id005
100
- - !ruby/object:Gem::Dependency
101
- name: rspec_tag_matchers
102
45
  prerelease: false
103
- requirement: &id006 !ruby/object:Gem::Requirement
46
+ version_requirements: *70356084607580
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec_tag_matchers
49
+ requirement: &70356084607100 !ruby/object:Gem::Requirement
104
50
  none: false
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- hash: 23
109
- segments:
110
- - 1
111
- - 0
112
- - 0
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
113
54
  version: 1.0.0
114
55
  type: :development
115
- version_requirements: *id006
116
- - !ruby/object:Gem::Dependency
117
- name: hpricot
118
56
  prerelease: false
119
- requirement: &id007 !ruby/object:Gem::Requirement
57
+ version_requirements: *70356084607100
58
+ - !ruby/object:Gem::Dependency
59
+ name: hpricot
60
+ requirement: &70356084606620 !ruby/object:Gem::Requirement
120
61
  none: false
121
- requirements:
62
+ requirements:
122
63
  - - ~>
123
- - !ruby/object:Gem::Version
124
- hash: 57
125
- segments:
126
- - 0
127
- - 8
128
- - 3
64
+ - !ruby/object:Gem::Version
129
65
  version: 0.8.3
130
66
  type: :development
131
- version_requirements: *id007
132
- description: A Rails form builder plugin/gem with semantically rich and accessible markup
67
+ prerelease: false
68
+ version_requirements: *70356084606620
69
+ description: A Rails form builder plugin/gem with semantically rich and accessible
70
+ markup
133
71
  email: justin@indent.com.au
134
72
  executables: []
135
-
136
73
  extensions: []
137
-
138
- extra_rdoc_files:
74
+ extra_rdoc_files:
139
75
  - README.textile
140
- files:
76
+ files:
141
77
  - generators/form/form_generator.rb
142
78
  - generators/form/USAGE
143
79
  - generators/formtastic/formtastic_generator.rb
@@ -160,39 +96,39 @@ files:
160
96
  - MIT-LICENSE
161
97
  - README.textile
162
98
  - init.rb
163
- has_rdoc: true
164
99
  homepage: http://github.com/justinfrench/formtastic/tree/master
165
100
  licenses: []
166
-
167
- post_install_message: "\n ========================================================================\n Thanks for installing Formtastic!\n ------------------------------------------------------------------------\n You can now (optionally) run the generator to copy some stylesheets and\n a config initializer into your application:\n rails generate formtastic:install # Rails 3\n ./script/generate formtastic # Rails 2\n\n To generate some semantic form markup for your existing models, just run:\n rails generate formtastic:form MODEL_NAME # Rails 3\n ./script/generate form MODEL_NAME # Rails 2\n\n Find out more and get involved:\n http://github.com/justinfrench/formtastic\n http://groups.google.com.au/group/formtastic\n ========================================================================\n "
168
- rdoc_options:
101
+ post_install_message: ! "\n ========================================================================\n
102
+ \ Thanks for installing Formtastic!\n ------------------------------------------------------------------------\n
103
+ \ You can now (optionally) run the generator to copy some stylesheets and\n a config
104
+ initializer into your application:\n rails generate formtastic:install # Rails
105
+ 3\n ./script/generate formtastic # Rails 2\n\n To generate some semantic
106
+ form markup for your existing models, just run:\n rails generate formtastic:form
107
+ MODEL_NAME # Rails 3\n ./script/generate form MODEL_NAME # Rails 2\n\n
108
+ \ Find out more and get involved:\n http://github.com/justinfrench/formtastic\n
109
+ \ http://groups.google.com.au/group/formtastic\n ========================================================================\n
110
+ \ "
111
+ rdoc_options:
169
112
  - --charset=UTF-8
170
- require_paths:
113
+ require_paths:
171
114
  - lib
172
- required_ruby_version: !ruby/object:Gem::Requirement
115
+ required_ruby_version: !ruby/object:Gem::Requirement
173
116
  none: false
174
- requirements:
175
- - - ">="
176
- - !ruby/object:Gem::Version
177
- hash: 3
178
- segments:
179
- - 0
180
- version: "0"
181
- required_rubygems_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
182
122
  none: false
183
- requirements:
184
- - - ">="
185
- - !ruby/object:Gem::Version
186
- hash: 3
187
- segments:
188
- - 0
189
- version: "0"
123
+ requirements:
124
+ - - ! '>='
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
190
127
  requirements: []
191
-
192
128
  rubyforge_project:
193
- rubygems_version: 1.3.7
129
+ rubygems_version: 1.8.11
194
130
  signing_key:
195
131
  specification_version: 3
196
132
  summary: A Rails form builder plugin/gem with semantically rich and accessible markup
197
133
  test_files: []
198
-
134
+ has_rdoc: