formtastic 3.0.0.rc → 3.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZWRiMTU5NmRkZjA1NTEzMDkyZTkzNjU4MjZlZjQ2M2JlNGUxNTllZg==
4
+ YjA0MzU4YTY2YmJhNmFkOTRmMGNiYmIxZTViNGYyZDlhZWM4YWJmMg==
5
5
  data.tar.gz: !binary |-
6
- NTMyNjFhNjhhMjQxOGRkMmFjOGZkM2YxY2EzOWU0MzhjZjc3MWE0Yg==
6
+ Yzk0NzdkZmE1MmI0N2RhMDYzMWE3NzMyMjkwMjk4ZDIxMTcyZWFjZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzIxNDg1NzU1MzdhMmMxYTAzNDhkMDgxZDUyMzNiMTZjNTE3ODc1ZWRmNjk1
10
- NzU5NmUzZjFhZDZhOTBlZGIxNDE5N2VmOTI1MDI1ZTM0NDY3ZTY4ZDk5YTNk
11
- YjBmNjM0OTEyNTIzZWFmNWQxZTcxZmUzMWVhMDNmZTFlMWQ5ODE=
9
+ NjJkNTk4N2YwNGFiZWY4NDYyN2Y4MjBmZmE3YWE0M2UzNDIxZTIxYzhlNWEz
10
+ ODYzZjg3YmQ5MTUyNjk0ODIwZjViZGU3MzMxNzg0MDYzMmY0NDEwNGM0ZTk4
11
+ Yzk5MmZiZTIwMmNiNDljNGVhYWFmMzA4MDIwZGI1NjQ5ZjA3OWI=
12
12
  data.tar.gz: !binary |-
13
- NmUzYWQ0Y2I5OWNhYzlmY2NlMjRjZjE5OTE1MzYwYTZmMjUxNGUwYmU2ZmEz
14
- MWVhNTYyMTMyMDlmMDM0MTY3Zjk3NDYzMTdlOTU1YTI5Mjc2MGEzZjhjMWVm
15
- YTVlNTBiMzJjNjIwNDBhZWI0OTY3ZmVlMjYxNzdjZGMzNDVlZWU=
13
+ MjFmNGM0Y2ZlOTEwYWJlN2FhYjViNWFlYzJhODA2ODMzZGUzZTdmYmMyM2Iy
14
+ ODYzOWIyMzQ0MzZlMGZjYzkwMGY1MWFlZTViOGE2YzgyZDY4Y2Q1ZGJhMmE2
15
+ MjBhZDk1NDFjOWYzYjJkMGU2ZjM3ZTE5NmEzMGI0MjQyODExMTY=
data/.travis.yml CHANGED
@@ -10,6 +10,7 @@ gemfile:
10
10
  - gemfiles/rails_3.2.gemfile
11
11
  - gemfiles/rails_4.gemfile
12
12
  - gemfiles/rails_4.0.4.gemfile
13
+ - gemfiles/rails_4.1.gemfile
13
14
  - gemfiles/rails_edge.gemfile
14
15
  env:
15
16
  - DEFER_GC=false RAILS_EDGE=true
data/Appraisals CHANGED
@@ -1,5 +1,5 @@
1
1
  appraise 'rails-3.2' do
2
- gem 'rails', '~> 3.2.0'
2
+ gem 'rails', '~> 3.2.0'
3
3
  end
4
4
 
5
5
  appraise 'rails-4' do
@@ -11,8 +11,15 @@ appraise 'rails-4.0.4' do
11
11
  gem 'rails', '4.0.4'
12
12
  end
13
13
 
14
+ appraise 'rails-4.1' do
15
+ gem 'rails', '~>4.1.0'
16
+ end
17
+
14
18
  if ENV["RAILS_EDGE"] == "true"
15
19
  appraise 'rails-edge' do
16
20
  gem 'rails', :git => 'git://github.com/rails/rails.git'
21
+ gem 'rack', :github => 'rack/rack'
22
+ gem 'i18n', :github => 'svenfuchs/i18n'
23
+ gem 'arel', :github => 'rails/arel'
17
24
  end
18
25
  end
data/CHANGELOG CHANGED
@@ -1,440 +1,18 @@
1
- 2.3.0.rc3
2
-
3
- * Fixed invalid HTML attributes in BooleanInput with a whitelist
4
- * Fixed compatibility with Rails 4.0.x, 4.1
5
- * Fixed compatibility with newer I18n
6
- * Fixed compatibility with Paperclip
7
- * Fixed submit button in slim template
8
- * Fixed class with Rails' field_error_proc
9
- * Deprecated :error_class option
10
- * Deprecated support for Rails < 3.2.13
11
- * Added ability to change the model-derived class we add to the form (eg 'post')
12
- * Added support for symbols & sets in collections
13
-
14
- 2.3.0.rc2
15
-
16
- * deprecate support for Rails < 3.2
17
- * avoid clobbering `ActionView::Base.field_error_proc=` by using a custom class attribute: `Formtastic::Helpers::FormHelper.formtastic_field_error_proc=`.
18
-
19
- 2.3.0.rc
20
-
21
- * Updated to support Rails 4
22
- * Added custom HTML for the options within a checkboxes input group
23
- * Changed the format of the `value` attribute on `datetime_picker` input to be compliant with the HTML standards
24
- * Added `Formtastic::Helpers::FormHelper.field_error_proc=` for setting a custom proc
25
- * Fixed checked state of checkboxes when the values are integers
26
- * Fixed CSS to prevent numeric inputs with a `max` from stretching to full width
27
- * Added support for `:labels => false` on time selects
28
- * Improved documentation
29
-
30
- 2.2.1
31
-
32
- * Rails 4 compatibilty updates
33
- * corrected configuration template for i18n lookups, which default to true
34
- * removed custom_inline_order from configuration and template (code was removed in 2.0)
35
- * added documentation for button/action i18n keys
36
- * other documentation improvements
37
-
38
- 2.2.0
39
-
40
- * documentation improvements for generator
41
-
42
- 2.2.0.rc
43
-
44
- * removed deprecated buttons DSL, ButtonHelper and commit_button helper
45
- * deprecated the top-level :value option that is only used by HiddenInput
46
- * deprecated :hint_class option (use global configuration)
47
- * deprecated :error_class option (use global configuration)
48
- * deprecated :group_by and :group_label (use :collection option with a HTML string generated by Rails' grouped_options_for_select())
49
- * deprecated :find_options
50
- * renamed TimeInput (:as => :time) to TimeSelectInput (:as => :time_select), aliased and deprecated TimeInput
51
- * renamed DatetimeInput (:as => :datetime) to DatetimeSelectInput (:as => :datetime_select), aliased and deprecated DatetimeInput
52
- * renamed DateInput (:as => :date) to TimeSelectInput (:as => :date_select), aliased and deprecated DateInput
53
- * added DatePickerInput (:as => :date_picker) for HTML5 date inputs
54
- * added TimePickerInput (:as => :time_picker) for HTML5 time inputs
55
- * added DateTimePickerInput (:as => :datetime_picker) for HTML5 datetime and datetime-local inputs
56
- * added support for Rails 4 (edge)
57
- * improved error message on Formtastic::UnknownInputError
58
- * improved documentation for asset pipeline and condition stylesheets (IE)
59
-
60
- 2.1.1
61
-
62
- * Documentation improvements and updates
63
- * Fixed that the required string was appended to the label over and over due to localizer caching
64
- * Fixed that the checkbox's `name` attribute was included in the attributes of the matching label element on boolean fields
65
-
66
- 2.1.0
67
-
68
- * no changes
69
-
70
- 2.1.0.rc
71
-
72
- * documentation improvements
73
- * improved performance by caching of Formtastic's i18n lookups
74
- * improved performance in production by checking for defined constants instead of catching the exception
75
- * fixed arguments passed into fields_for being flattened one level too deep
76
- * added an optional `index` that an inputs() block can access for use in labels and other HTML attributes
77
-
78
- 2.1.0.beta
79
-
80
- * Added Rails 3.2 compatibility
81
- * Added a new Actions DSL (f.actions, f.action) — see below for deprecation of the Buttons DSL
82
- * Added new i18n_localizer configuration, allowing you to use your own localiser class instead of Formtastic::Localizer
83
- * Added a hidden input before mutli-selects, to allow full clearing of the select (like we do for checkboxes)
84
- * Added support for integers in a :collection for radio and check_boxes inputs
85
- * Added support for time inputs with no current value to default render blank inputs rather than pre-selecting the current time
86
- * Brought back the Form Generator from 1.2.x versions of Formtastic
87
- * Added support for placeholder text on textareas (text inputs)
88
- * Deprecated the Buttons DSL (f.buttons, f.commit_button) in favor of the new Actions DSL — see above
89
- * Removed the previously deprecated :label_method, :value_method & :group_label_method options
90
- * Removed the previously deprecated :as => :numeric
91
- * Removed the previously deprecated inline_errors_for and related methods
92
- * Removed the previously deprecated SemanticFormHelper and SemanticFormBuilder
93
- * Fixed the behavior of :include_blank and :prompt options to be inline with Rails’
94
- * Fixed that :input_html => { :multiple => true } did not force a single choice select into a multi choice
95
- * Fixed date, time and datetime legend labels to correspond to the first visible input, rather than the first input (which may be hidden)
96
- * Fixed that DateInput should treat fragments excluded from :order option as discarded
97
- * Fixed that the :wrapper_html options could not be reused in the view (like in a with_options block) because they were modified by Formtastic
98
- * Fixed numerous Mongoid and MongoMapper compatibility issues
99
- * Fixed that we should be calculating the length of integer columns as bytes
100
- * Fixed many inputs (date, datetime, time, checkboxes, select & boolean) that did not correctly use the :index option in fields_for
101
- * Fixed Haml and Slim template indentation
102
- * Fixed invalid html output for nested inputs with multiple siblings
103
- * Fixed i18n keys with nested objects
104
- * Many documentation fixes and improvements
105
- * A few performance improvements
106
-
107
- 2.0.2
108
-
109
- * Fixed that MongoMapper does not use `associations(method)`. `.associations` is an accessor.
110
-
111
- 2.0.1
112
-
113
- * fixed that `:multiple => true` wasn't working when no association present
114
-
115
- 2.0.0
116
-
117
- * Fixed that all check boxes were incorrectly checked if an Array was passed in to :collection
118
- * Improved README
119
- * Added form generator template for Slim template engine
120
- * Added support for Proc conditions in collection_from_association
121
- * Refactored commit button. Split it into a couple of different methods to make it easier to override.
122
-
123
- 2.0.0.rc5
124
-
125
- * Changed perform_browser_validations and use_required_attribute configuration defaults from true to false for a better out-of-the-box experience and upgrade path
126
- * Fixed that the `novalidate` attribute was being applied to the `<form>` tag when it shouldn't have been (and vice-versa)
127
- * Fixed `undefined method `last' for #<Classname>` with a `:collection` containing an array of arrays
128
-
129
- 2.0.0.rc4
130
-
131
- * Fixed that TimeInput was not rendering hidden y/m/d inputs by default.
132
- * Fixed test suite under Rails 3.1.0.rc5
133
- * Fixed false and blank fragment labels on date/time inputs producing unsafe HTML.
134
- * Fixed that inputs were 'required' withput considering `:on => :create` validations
135
- * Fixed that collections of strings in CheckBoxesInput were ot being correctly checked be checked if they match the model
136
- * Fixed that the required attribute was added to the choices in a :radio or :check_boxes input, instead of just the parent input wrapper
137
- * Fixed semantic_fields_for when used with a hash-like model
138
- * Fixed that models without defined validations (even if validators_on exists) should not be considered required
139
- * Fixed min/max attributes when the validation uses a Proc
140
- * Fixed that inputs should not be considered required if :allow_blank => true is set on validates_inclusion_of
141
- * Fixed that inputs should not be considered required if if either :allow_blank => true, :minimum is > 0, or :within's least value is > 0 is set on validates_length_of
142
- * Fixed a typo in the config template
143
- * Fixed semantic_fields_for to work with Rails 3 *and* 3.1's method sigs (I hope), many thanks to the simple_form guys for figuring this out
144
- * Changed HTML5 `step` attribute to default to "any" instead of "1"
145
- * Added CarrierWave support for to file input detection
146
- * Added a configuration 'perform_browser_validations' to opt out of HTML5 browser validations.
147
- * Added more support for mongo documents, including MongoMapper-specific reflection capability
148
- * Added IE specific stylesheets & moved those styles out of main stylesheet, include them yourself if needed
149
- * Added a new configuration to opt out of HTML5 required attribute
150
-
151
- 2.0.0.rc3
152
-
153
- * Fixed that .label class was incorrectly applied to <label> tags inside a .choice on radio and checkbox inputs (#599)
154
-
155
- 2.0.0.rc2
156
-
157
- * Fixed install instructions in readme to reflect 2.0.0.rc1
158
- * Fixed that the checkbox was mistakenly placed after the label text in BooleanInput, not before it as per 1.x (#591)
159
- * Fixed that select inputs had two "blank" options at the top in some cases (#590)
160
- * Added documentation for Timeish inputs (date, datetime, time) (#589)
161
-
162
- 2.0.0.rc1
163
-
164
- * Removed the "inline_order" configuration (redefine input_wrapping instead)
165
- * Removed the "special" implementation of label() from FormBuilder, so builder.label will call Rails' label helper, not ours
166
- * Changed the HTML id attribute used for hidden inputs to be consistent with all other inputs
167
- * Changed formtastic:form generator include the wrapping semantic_form_for block
168
- * Changed formtastic:form generator to generate a partial by default (instead of copying to clipboard, which can be done with --copy)
169
- * Removed formtastic_stylesheet_link_tag
170
- * Improved some documentation, much more to come
171
- * Tagged many modules as @private to remove from YARD documentation
172
- * Added YARD as development dependency for a massive documentation effort
173
- * Renamed Formtastic::SemanticFormHelper to Formtastic::Helpers::FormHelper (SemanticFormHelper still exists as a module which includes the new module, need to handle deprecation notices somehow)
174
- * Renamed Formtastic::SemanticFormBuilder to Formtastic::FormBuilder (SemanticFormBuilder still exists as a subclass, need to handle deprecation notices somehow)
175
- * Massive refactoring of formtastic.rb into around 30 files and modules like StringInput and ButtonsHelper
176
- * Removed chunks of Rails 2 specific code, tests and documentation
177
- * Added support for HTML5 required attribute on input, select and textarea tags
178
- * Added support for HTML5 min/max/step attributes on NumericInput
179
- * Added support for HTML5 placeholder attributes on Stringish inputs (string, email, phone, url, search, number, password)
180
- * Added support for HTML5 autofocus attributes
181
- * Changed nested inputs() blocks to be automatically wrapped in an `<li>` tag to preserve HTML validity
182
- * Changed quick forms to skip polymorphic associations (they didn't work)
183
- * Changed short hand forms to raise an error when trying to render an input for a polymorphic association (it didn't work, need a collection)
184
- * Changed input() to raise an error when a :collection is not provided for a polymorphic association (we can't guess which class to use)
185
- * Removed semantic_remote_form_for etc, the remote_form_for helpers don't exist in Rails 3
186
- * Changed :label_method option to :member_label (with backwards compat and deprecation warnings)
187
- * Changed :value_method option to :member_value (with backwards compat and deprecation warnings)
188
- * Changed :grouped_label_method option to :grouped_label (with backwards compat and deprecation warnings)
189
- * Added support for a Method objects to :member_label/:member_value (aka :label_method/:value_method)
190
- * Improved support for Mongoid
191
- * Changed Rails dependency from ~> 3.0.0 to ~> 3.0 to allow experimentation with Rails 3.1 betas
192
- * Removed some overly eager CSS resets on form elements that made Opera and FF inputs look pretty ugly
193
- * Removed specificity and duplication in CSS
194
- * Added many new classes to DOM elements to enable more efficient and descriptive CSS
195
- * Improved visual/spacing consistency in checkboxes
196
- * Added non-standard zoom:1; to clearfixes to support IE better
197
- * Changed CSS coding style to multi-line so we can annotate the styles better
198
- * Fixed that overly specific CSS rules weren't applied to nested form elements properly
199
- * Removed formtastic:form generator and changed formtastic:install generator
200
- to override scaffold generator
201
- * Refactored and consolidated CSS by adding extra class names into the mark-up, preferring to style by class instead of element wherever possible
202
- * Added IE6 and IE7 stylesheets for specific fixes if needed (uncomplicates formtastic.css)
203
- * Added support for Rails 3.1 asset pipeline as well as previous generated CSS for Rails < 3.1
204
- * Made many subtle visual improvements to CSS, especially in IE
205
-
206
- 1.2.4
207
-
208
- * no changes
209
-
210
- 1.2.4.beta2
211
-
212
- * Changed :boolean inputs to use Rails' check_box_checked? instead of our own logic
213
- * Changed developer instructions in README
214
- * Fixed :boolean inputs to disable the included hidden input when disabling the actual checkbox
215
- * Fixed that Formtastic was making changes to the options hash directly instead of on a duplicate, causing problems for those trying to reuse options on multiple inputs in the view
216
- * Fixed that tiny scroll bars were appearing on legends in date/time/radio/cbheckboxes fielsets (GH-477)
217
- * Fixed an issue when formtastic fails to determine if a checkbox is checked with custom checked and unchecked values (thanks to Eugene Bolshakov)
218
- * Fixed that the hidden input rendered with a boolean checkbox did nt use the custom :name from :input_html options hash
219
- * Fixed issue where Firefox 4 gives focus to the <li> wrapper (fixes #524).
220
- * Fixed that a shared input options hash could not be re-used in the view without being altered by each input
221
- * Improved compatibility with Mongoid Documents
222
- * Updated i18n dependency to ~> 0.4
223
-
224
- 1.2.4.beta
225
-
226
- * Changed :boolean inputs to use Rails' check_box_checked? instead of our own logic
227
- * Changed developer instructions in README
228
- * Fixed :boolean inputs to disable the included hidden input when disabling the actual checkbox
229
- * Fixed that Formtastic was making changes to the options hash directly instead of on a duplicate, causing problems for those trying to reuse options on multiple inputs in the view
230
- * Fixed that tiny scroll bars were appearing on legends in date/time/radio/cbheckboxes fielsets (GH-477)
231
- * Fixed an issue when formtastic fails to determine if a checkbox is checked with custom checked and unchecked values (thanks to Eugene Bolshakov)
232
- * Fixed that the hidden input rendered with a boolean checkbox did nt use the custom :name from :input_html options hash
233
-
234
- 1.2.3
235
-
236
- * Removed deprecated methods input_field_set, button_field_set, boolean_select_input, boolean_radio_input and boolean_radio_input
237
- * Removed deprecated :class option on commit_button (use :input_html instead)
238
- * Fixed that stylesheets and initializers directories would be removed on uninstalling
239
- * Fixed some documentation and formatting
240
- * Fixed test coverage issues under Ruby 192 and Rails 2
241
- * Fixed that input_html options were not being passed down to checkbox tags
242
- * Changed internal duplication of the options hash so that the same options hash can be re-used over multiple inputs without being altered
243
- * Changed internal configuration to use class_attribute when available (Rails 3) to avoid deprecation warnings
244
- * Added Rails 3 compatible form generator templates in addition to existing Rails 2 support
245
- * Added reflection on allow_blank option when determining the 'required' status of an input
246
-
247
-
248
- 1.2.2
249
-
250
- * Removed deprecated aliased input names (:as => :boolean_select, :as => :boolean_radio_input
251
- * Removed deprecated aliased method names (input_field_set, button_field_set)
252
- * Removed deprecated :class => 'whatever' on commit_button
253
- * Fixed that classes in :button_html were being merged into :wrapper_html
254
- * Fixed that :include_blank was being ignored (always false) for multi selects
255
- * Fixed that we should reflect on allow_blank option to determine required status with validates_inclusion_of
256
- * Added the ability to pass :input_html options be passed to the checkbox on a boolean input
257
- * Developers: Added bundler support to for developer/contribution
258
- * Developers: Fixed spec coverage under Rails 2 and Ruby 1.9.2
259
-
260
- 1.2.1
261
-
262
- * test suite compatibilities with Rails 3.0.3
263
-
264
- 1.2.1.beta3
265
-
266
- * Fixed bad merge related to :boolean inputs in 1.2.1.beta
267
-
268
- 1.2.1.beta2
269
-
270
- * Fixed typos in gemspec post-install message
271
-
272
- 1.2.1.beta
273
-
274
- * Fixed that unchecking :boolean inputs would not send the correct params (and not persist the change the the DB)
275
- * Fixed that :boolean inputs checked state was not reflecting the database/model value
276
- * Fixed that init.rb and rails/init.rb were not included in the gem (affecting Rails 2)
277
-
278
- 1.2.0
279
-
280
- * Changed default_text_area_width to nil, overlooked in recent CSS/width changes
281
- * Improved documentation
282
-
283
- 1.2.0.beta2
284
-
285
- * Added :wrapper_html functionality to commit_button() to match what input() does
286
- * Deprecated the :class option on commit_button(), use :wrapper_html instead
287
- * Added hpricot as missing development dependency
288
- * Improved documentation
289
-
290
- 1.2.0.beta
291
-
292
- * New Stuff
293
-
294
- * Added support for Paperclip's questionable use of multiple error keys on a single attribute, so errors on Paperclip :file inputs Just Work
295
- * Added ability for the error and hint class to be overridden with :hint_class and :error_class, and configurable defaults app-wide
296
- * Added basic support for multiple forms in the same document by allowing the element ids to be prefixed with the :namespace option on semantic_form_for
297
- * Added a fallback to Rails' helpers.label key if Formtastic label translation are not found
298
- * Added support for default_text_area_width
299
- * Added support for #persisted? over #new_record? (ActiveModel)
300
- * Added the 'required' logic to attributes with validates_inclusion_of validation, in addition to validates_presence_of
301
- * Added new HTML5 :as => :email input (Rails 3)
302
- * Added new HTML5 :as => :phone input (Rails 3)
303
- * Added new HTML5 :as => :search input (Rails 3)
304
- * Added new HTML5 :as => :url input (Rails 3)
305
- * Added the ability for the :collection option to accept a string of HTML (like the output from grouped_options_for_select), rather than just Arrays, Hashes, collections, etc.
306
- * Added the ability to set your own form class, instead of 'formtastic'
307
- * Added maxlength attributes to inputs if it can be determined via the ValidationReflection plugin or ActiveModel validation reflections
308
- * Added the ability to override the form class (Post => "post") through an :as option on semantic_form_for option
309
- * Added the ability to customize the order for specific types of inputs. This is configured on a type basis and if a type is not found it willfall back to the default order as defined by @@inline_order
310
- * Added :first as a new rendering choice for the errors on each input
311
- * Added custom_inline_order to allow inline ordering per input type
312
- * Added the ability to override the generator templates in Rails 3
313
-
314
- * Fixes
315
-
316
- * Fixed invalid HTML generated by Rails' hidden inputs on checkboxes (by rendering our own hidden tag in a more deliberate place)
317
- * Fixed a bunch of invalid i18n key defaults
318
- * Fixed that 'required' classes and logic were not being applied to :check_boxes and :radio inputs
319
- * Fixed CSS bugs around Firefox's quirks with form elements that resulted in overflow/scroll bar issues
320
- * Fixed that errors on fields with association were not marking the wrapping tag with the error class
321
- * Fixed CSS where FF was displaying extra scroll bars on .check_boxes and .radio inputs (and the choices within them)
322
-
323
- * Changes
324
-
325
- * Changed that we were defaulting to a :select input for columns ending in _id, instead of columns with an appropriate associations
326
- * Deprecated a bunch of aliased method names that should no longer be used
327
- * Removed deprecated :selected, :checked and :default options
328
- * Changed the width styling for string, numeric, password and other basic inputs, defaults to 75% unless the size attribute is present
329
- * Changed string, numeric, password and other basic inputs' default text field size config to nil instead of 50, meaning the size attribute will be ommitted from most inputs, makeing styling easier, and custom sizes with the size attribute more deliberate
330
- * Changed string, numeric, password and other basic inputs to no longer add the size attribute based on column information (the default config is applied, unless it's nil)
331
- * Changed text input css behaviour updated to be similar to string etc
332
- * Changed text inputs to no longer include a default cols attribute, specify it with :input_html if you need it, but the value we were using was useless... also beefed up spec coverage
333
- * Removed :label calls from the generated ERB in the form generator (i18n is preferred)
334
- * Changed that :select inputs for HABTM associations would ignore the :include_blank option
335
- * Changed the default method on collections from Model.find(:all) to Model.all
336
- * Removed the deprecated formtastic_stylesheets generator
337
- * Changed the minimum Rails version to 2.3.7, which the earliest version which the specs pass with
338
- * Changed :password inputs to be sized by percentage (like other string-ish inputs), rather then em-based
339
-
340
- 1.1.0
341
-
342
- * documentation changes only
343
-
344
- 1.1.0.beta [Specs passed against Rails 2.3.8, 3.0.0.rc & 3.0.0]
345
-
346
- * Changed semantic_remote_form_for to allow for unobstrusive javascript / :remote option (rails3)
347
- * Changed spec_helper to support Rails 2 with RSpec or Rails 3 with RSpec 2 environments
348
- * Changed Rakefile to initalize the correct testing framework for the enviroment
349
- * Changed i18n dependency to >= 0.4
350
- * Fixed use of model_name.human instead of model_name.human_name (rails3)
351
- * Fixed use of deprecated Errors#on_base
352
- * Fixed use of ActionController::RecordIdentifier#singular_class_name (rails3)
353
- * Added railtie to perform initialization tasks after the rails framework is available (rails3)
354
- * Added compatible install and form helpers (rails3)
355
- * Added support for ActiveModel Validations, thanks to Guillaume Belleguic (rails3)
356
-
357
- 1.0.1
358
-
359
- * fixed "already initialised constant" warnings on boot
360
-
361
- 1.0.0
362
-
363
- * nothing changed from rc2
364
-
365
- 1.0.0.rc2
366
-
367
- * Fixed that :label=>false didn't disable the label on checkboxes/radiobuttons (#331)
368
- * Added full support of :input_html options for hidden fields
369
-
370
- 1.0.0.rc
371
-
372
- * Fixed that :checked_value and :unchecked_value options were being passed down into the HTML tags as attributes
373
-
374
- 1.0.0.beta4
375
-
376
- * ensure i18n < 0.4 is listed as a dependency in the gemspec
377
-
378
- 1.0.0.beta3
379
-
380
- * Added :ignore_date option to time inputs (#308)
381
- * Fixed inputs_for_nested_attributes returning out of the proc on has_many associated nested models.
382
- * Fixed with_custom_field_error_proc to use ensure for restoring default field_error_proc and to store it in a local variable instead of in a class variable (nested calls were problematic due to the globalness of class variables)
383
-
384
- 1.0.0.beta2
385
-
386
- * Added default escaping of html entities in labels and hints (#292, #299)
387
- * Added/Fixed that :value_method and :label_method were not being used for simple collections (like Arrays)
388
- * Added some more compatibility for Mongooid and other ORMs by checking for reflection information before calling it
389
- * Fixed deprecation warnings in Rails 2.3.6 and newer
390
- * Fixed a bug where :check_boxes and :radio were using method instead of :label option
391
- * Fixed a conflict where i18n lookups were failing when an attribute and model have the same name
392
- * Fixed some html that was not marked as safe
393
-
394
- 1.0.0.beta
395
-
396
- * Fixed :radio and :check_boxes inputs so that the legend no longer includes a <label> with a `for` attribute pointing to an input that doesn't exist (#253)
397
- * Fixed that some inputs had invalid 'find_options' attribute (#262)
398
- * Fixed that we were calling html_safe! when it was not always available
399
- * Added the ability for :input_html to now accept an option of :size => nil, to exclude the :size attribute altogether (#267)
400
-
401
- 0.9.10
402
-
403
- * Fixed i18n incompatibility with Rails 2.3.8 by reverting two i18n patches pulled in from the rails3 branch
404
-
405
- 0.9.9
406
-
407
- * Changed date/time inputs to default to nil instead of Time.now when the object has no value (due to deprecation warning, #240)
408
- * Changed the behaviour of associations with a :class_name option to be more consistent with what Rails expects
409
- * Fixed issues relating to Rails 2.3.6 automatically escaping ERB
410
- * Fixed issues with Ruby 1.9.1 and Haml
411
- * Fixed use of deprecated {{key}} syntax in i18n interpolation (thanks to Hans Petter Wilhelmsen)
412
- * Added the :disabled option to check_boxes input
413
- * Added translation support for nested models (thanks to Toni Tuominen)
414
-
415
- 0.9.8
416
-
417
- * Deprecated :selected/:checked options, see http://wiki.github.com/justinfrench/formtastic/deprecation-of-selected-option
418
- * Changed CSS rules for fieldset lists to be more specific
419
- * Changed that radio and checkbox inputs used to associate the legend label with the first choice's input (#101)
420
- * Changed the generators to use |f| rather than |form| (#151)
421
- * Changed the behaviour of :selected/:checked options to address several bugs and inconsistencies (#152)
422
- * Changed CSS for input width property to max-width, allowing a size attribute to still be set
423
- * Fixed an issue where label_str_method not honoured if the object is an ActiveRecord object
424
- * Fixed incorrect html class for namespaced objects ("/" replaced with "_")
425
- * Fixed compatibility issue with SearchLogic (#155)
426
- * Fixed an issue where label_str_method was not being overridden with i18n
427
- * Fixed a button text issue with Rails 2.x in which human_name on multi-word models returned one word (eg Ticketrequest) (#153)
428
- * Fixed the behaviour of select inputs when the belongs_to or has_many association has a special :class_name option
429
- * Fixed line numbers from eval'd code, to help when debugging
430
- * Fixed CSS issue that hidden fields were not always hidden (Chrome for example) (#209)
431
- * Fixed and improved CSS with nested fieldsets and legends
432
- * Fixed date/time inputs where :include_seconds => true
433
- * Fixed that inline hints were still being rendered on hidden inputs
434
- * Fixed broken CSS declaration missing a colon
435
- * Added configuration preferences for row and column attributes on textareas
436
- * Added semantic_errors helper and CSS (for all errors on an object)
437
- * Added :filename to the list of @@file_methods, to support carrierwave plugin (#156)
438
- * Added a Formtastic::LayoutHelper with formtastic_stylesheets helper method for linking to all Formtastic CSS files
439
- * Added labels option to date/time/datetime fields to customise the label of each part of the set (year, month, etc)
440
- * Added many improvements to the README and docs
1
+ 3.0.0.rc
2
+
3
+ * Removed support for Ruby version < 1.9.3
4
+ * Removed support for Rails version < 3.2.13
5
+ * Removed deprecated option :input_html => { :value => '...'} (#1025)
6
+ * Removed deprecated option :hint_class (#1025)
7
+ * Removed deprecated option :error_class (#1025)
8
+ * Removed deprecated option :group_by (#1025)
9
+ * Removed deprecated option :group_label (#1025)
10
+ * Removed deprecated option :find_options (#1025)
11
+ * Deprecated support for Rails < 4.0.4
12
+ * Changed i18n lookups to use the `:as` option from the form builder (#1033)
13
+ * Improved documentation for country_select gem compatibility & support (#1061)
14
+ * Improved documentation for browser support of datetime and datetime-local (#1029)
15
+ * Added support for ColorInput (:as => :color) in Rails 4 (#1039)
16
+
17
+ See 2.3-stable branch for earlier releases
18
+ https://github.com/justinfrench/formtastic/blob/2.3-stable/CHANGELOG
data/README.textile CHANGED
@@ -107,21 +107,6 @@ h2. Stylesheets
107
107
 
108
108
  A proof-of-concept set of stylesheets are provided which you can include in your layout. Customization is best achieved by overriding these styles in an additional stylesheet.
109
109
 
110
- h3. Stylesheet usage in Rails < 3.1:
111
-
112
- <pre>
113
- $ rails generate formtastic:install
114
- </pre>
115
-
116
- <pre>
117
- # app/views/layouts/application.html.erb
118
- <%= stylesheet_link_tag 'formtastic', 'my_formtastic_changes' %>
119
- <!--[if IE 6]><%= stylesheet_link_tag 'formtastic_ie6' %><![endif]-->
120
- <!--[if IE 7]><%= stylesheet_link_tag 'formtastic_ie7' %><![endif]-->
121
- </pre>
122
-
123
- h3. Stylesheet usage in Rails >= 3.1:
124
-
125
110
  Rails 3.1 introduces an asset pipeline that allows plugins like Formtastic to serve their own Stylesheets, Javascripts, etc without having to run generators that copy them across to the host application. Formtastic makes three stylesheets available as an Engine, you just need to require them in your global stylesheets.
126
111
 
127
112
  <pre>
data/Rakefile CHANGED
@@ -7,11 +7,10 @@ require 'rspec/core/rake_task'
7
7
  Bundler::GemHelper.install_tasks
8
8
 
9
9
  desc 'Default: run unit specs.'
10
- task :default => :all
11
-
12
- desc 'Test formtastic with all supported Rails versions.'
13
- task :all => ["appraisal:install"] do
14
- exec('rake appraisal spec')
10
+ if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
11
+ task :default => :appraisal
12
+ else
13
+ task :default => :spec
15
14
  end
16
15
 
17
16
  desc 'Generate documentation for the formtastic plugin.'
data/formtastic.gemspec CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.add_development_dependency(%q<BlueCloth>, ["~> 1.0"]) # for YARD
35
35
  s.add_development_dependency(%q<yard>, ["~> 0.6"])
36
36
  s.add_development_dependency(%q<colored>, ["~> 1.2"])
37
- s.add_development_dependency(%q<tzinfo>, ["~> 1.1"])
37
+ s.add_development_dependency(%q<tzinfo>)
38
38
  s.add_development_dependency(%q<ammeter>, ["0.2.5"])
39
39
  s.add_development_dependency(%q<appraisal>, ["~> 1.0"])
40
40
  s.add_development_dependency(%q<rake>, ["<= 10.1.1"]) # Anything higher requires Ruby 1.9, drop in v3.0
@@ -4,4 +4,4 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 3.2.0"
6
6
 
7
- gemspec :path=>".././"
7
+ gemspec :path => "../"
@@ -4,4 +4,4 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "4.0.4"
6
6
 
7
- gemspec :path=>".././"
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~>4.1.0"
6
+
7
+ gemspec :path => "../"
@@ -4,4 +4,4 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 4.0.0"
6
6
 
7
- gemspec :path=>".././"
7
+ gemspec :path => "../"
@@ -2,6 +2,9 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", :git=>"git://github.com/rails/rails.git"
5
+ gem "rails", :git => "git://github.com/rails/rails.git"
6
+ gem "rack", :github => "rack/rack"
7
+ gem "i18n", :github => "svenfuchs/i18n"
8
+ gem "arel", :github => "rails/arel"
6
9
 
7
- gemspec :path=>"../"
10
+ gemspec :path => "../"
@@ -102,7 +102,9 @@ module Formtastic
102
102
  value
103
103
  when NilClass
104
104
  false
105
- when Integer, String
105
+ when Integer
106
+ value == checked_value.to_i
107
+ when String
106
108
  value == checked_value
107
109
  when Array
108
110
  value.include?(checked_value)
@@ -1,3 +1,3 @@
1
1
  module Formtastic
2
- VERSION = "3.0.0.rc"
2
+ VERSION = "3.0.0.rc2"
3
3
  end
@@ -8,18 +8,21 @@ describe 'boolean input' do
8
8
  before do
9
9
  @output_buffer = ''
10
10
  mock_everything
11
-
12
- concat(semantic_form_for(@new_post) do |builder|
13
- concat(builder.input(:allow_comments, :as => :boolean))
14
- end)
15
11
  end
16
12
 
17
- it_should_have_input_wrapper_with_class("boolean")
18
- it_should_have_input_wrapper_with_class(:input)
19
- it_should_have_input_wrapper_with_id("post_allow_comments_input")
20
- it_should_apply_error_logic_for_input_type(:boolean)
21
-
22
- it 'should generate a label containing the input' do
13
+ describe 'generic' do
14
+ before do
15
+ concat(semantic_form_for(@new_post) do |builder|
16
+ concat(builder.input(:allow_comments, :as => :boolean))
17
+ end)
18
+ end
19
+
20
+ it_should_have_input_wrapper_with_class("boolean")
21
+ it_should_have_input_wrapper_with_class(:input)
22
+ it_should_have_input_wrapper_with_id("post_allow_comments_input")
23
+ it_should_apply_error_logic_for_input_type(:boolean)
24
+
25
+ it 'should generate a label containing the input' do
23
26
  output_buffer.should_not have_tag('label.label')
24
27
  output_buffer.should have_tag('form li label', :count => 1)
25
28
  output_buffer.should have_tag('form li label[@for="post_allow_comments"]')
@@ -27,24 +30,25 @@ describe 'boolean input' do
27
30
  output_buffer.should have_tag('form li label input[@type="checkbox"]', :count => 1)
28
31
  output_buffer.should have_tag('form li input[@type="hidden"]', :count => 1)
29
32
  output_buffer.should_not have_tag('form li label input[@type="hidden"]', :count => 1) # invalid HTML5
30
- end
31
-
32
- it 'should not add a "name" attribute to the label' do
33
- output_buffer.should_not have_tag('form li label[@name]')
34
- end
35
-
36
- it 'should generate a checkbox input' do
37
- output_buffer.should have_tag('form li label input')
38
- output_buffer.should have_tag('form li label input#post_allow_comments')
39
- output_buffer.should have_tag('form li label input[@type="checkbox"]')
40
- output_buffer.should have_tag('form li label input[@name="post[allow_comments]"]')
41
- output_buffer.should have_tag('form li label input[@type="checkbox"][@value="1"]')
42
- end
43
-
44
- it 'should generate a checked input if object.method returns true' do
45
- output_buffer.should have_tag('form li label input[@checked="checked"]')
46
- output_buffer.should have_tag('form li input[@name="post[allow_comments]"]', :count => 2)
47
- output_buffer.should have_tag('form li input#post_allow_comments', :count => 1)
33
+ end
34
+
35
+ it 'should not add a "name" attribute to the label' do
36
+ output_buffer.should_not have_tag('form li label[@name]')
37
+ end
38
+
39
+ it 'should generate a checkbox input' do
40
+ output_buffer.should have_tag('form li label input')
41
+ output_buffer.should have_tag('form li label input#post_allow_comments')
42
+ output_buffer.should have_tag('form li label input[@type="checkbox"]')
43
+ output_buffer.should have_tag('form li label input[@name="post[allow_comments]"]')
44
+ output_buffer.should have_tag('form li label input[@type="checkbox"][@value="1"]')
45
+ end
46
+
47
+ it 'should generate a checked input if object.method returns true' do
48
+ output_buffer.should have_tag('form li label input[@checked="checked"]')
49
+ output_buffer.should have_tag('form li input[@name="post[allow_comments]"]', :count => 2)
50
+ output_buffer.should have_tag('form li input#post_allow_comments', :count => 1)
51
+ end
48
52
  end
49
53
 
50
54
  it 'should generate a checked input if :input_html is passed :checked => checked' do
@@ -127,6 +131,16 @@ describe 'boolean input' do
127
131
  output_buffer.should have_tag('form li label input[@type="checkbox"][@value="yes"][@checked="checked"]')
128
132
  end
129
133
 
134
+ it 'should generate a checked input for boolean database values compared to string checked values' do
135
+ @new_post.stub(:foo).and_return(1)
136
+
137
+ concat(semantic_form_for(@new_post) do |builder|
138
+ concat(builder.input(:foo, :as => :boolean))
139
+ end)
140
+
141
+ output_buffer.should have_tag('form li label input[@type="checkbox"][@value="1"][@checked="checked"]')
142
+ end
143
+
130
144
  it 'should generate a checked input if object.method returns checked value when inverted' do
131
145
  @new_post.stub(:allow_comments).and_return(0)
132
146
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formtastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.rc
4
+ version: 3.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin French
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-13 00:00:00.000000000 Z
11
+ date: 2014-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -126,16 +126,16 @@ dependencies:
126
126
  name: tzinfo
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - ! '>='
130
130
  - !ruby/object:Gem::Version
131
- version: '1.1'
131
+ version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - ! '>='
137
137
  - !ruby/object:Gem::Version
138
- version: '1.1'
138
+ version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: ammeter
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -218,6 +218,7 @@ files:
218
218
  - formtastic.gemspec
219
219
  - gemfiles/rails_3.2.gemfile
220
220
  - gemfiles/rails_4.0.4.gemfile
221
+ - gemfiles/rails_4.1.gemfile
221
222
  - gemfiles/rails_4.gemfile
222
223
  - gemfiles/rails_edge.gemfile
223
224
  - lib/formtastic.rb