simple_form 3.0.0.rc → 3.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eebdc48d53472ed80e668fd6c2fa30ebf30695a1
4
- data.tar.gz: 368a258b70c60fcb73ed568a21f357b39c1fa93f
3
+ metadata.gz: 16a083a7be892436f572b9e055699a94d889d8ca
4
+ data.tar.gz: 5240794b73edefddc037c5a528f3a5eb362fb7bc
5
5
  SHA512:
6
- metadata.gz: fd1c37c0fffa1d3f3b5a06d19790f37a6aec133ab9d98d792c0c60ba40ea64628085ef8f26ab8f44a50bb17af3b0ee3e8dfdcd6d2997dfea021bc41240c300ed
7
- data.tar.gz: ee7024a3684a698d0267fd2469723bfca7775270f064b0e11680cc85891c8d6d235189bd608d636fc551c7d3726b3d8167577ebc49869bc8c6969254c7ee5d00
6
+ metadata.gz: 54cfce6263962c3918d36467a0681dc31e48262a777110c2e05ebf4f8daa8bf2ce8c0dec773c9cf37d60af34f424936d09766e34ccb98572780c0f877d9051b8
7
+ data.tar.gz: 70d460b6f6f5467aa84b599ffc5e1cdbb59b6b581d5cc51ac064c2f2100b1ed70f1550073db7ca3670a4955a2a33a49657b81a3c70b6e3bdccef1a0ab88227e4
data/CHANGELOG.md CHANGED
@@ -1,20 +1,32 @@
1
- ## master
2
-
3
- ### enhancements
4
- * Make `field_error_proc` configurable [@dfens](https://github.com/dfens)
1
+ ## 3.0.1
5
2
 
6
3
  ### bug fix
7
- * Remove deprecation warnings related to `Relation#all` from Rails 4.
8
- * Form builder can be used outside the context of a controller [@jasonwebster](https://github.com/jasonwebster)
9
- * Skip pattern attribute when using `validates_format_of` with `:without` option [@glebm](https://github.com/glebm)
4
+ * Fix XSS vulnerability on label, hint and error components.
10
5
 
11
- ## 3.0.0.beta1
6
+ ## 3.0.0
12
7
 
13
8
  ### enhancements
9
+ * New `input_class` global config option to set a class to be generated in all inputs.
10
+ * Collection tags accept html attributes as the last element of collection [@nashby](https://github.com/nashby)
11
+ * Change default `:value_method` of collection tags from `:last` to `:second` [@nashby](https://github.com/nashby)
12
+ * Support `Proc` object in `:conditions` option of associations [@bradly](https://github.com/bradly)
13
+ * `input_field` supports `html5` component [@nashby](https://github.com/nashby)
14
+ * Make `field_error_proc` configurable [@dfens](https://github.com/dfens)
14
15
  * Support to Rails 4.
15
16
  * Removed deprecated methods.
16
17
  * SimpleForm no longer sets the `size` attribute automatically and the `default_input_size` setting
17
18
  is now deprecated.
18
19
  * Support to aria-required attribute to required fields [@ckundo](https://github.com/ckundo)
19
20
 
21
+ ### bug fix
22
+ * Make `DateTimeInput#label_target` method to work with string values in `I18n.t('date.order')` (default
23
+ behaviour in Rails 4)
24
+ Closes [#846](https://github.com/plataformatec/simple_form/issues/846) [@mjankowski](https://github.com/mjankowski)
25
+ * Add "checkbox" class to the label of boolean input when there is no `:label`
26
+ in `generate_additional_classes_for` config option [@nashby](https://github.com/nashby)
27
+ * Support models with digits in their names [@webgago](https://github.com/webgago)
28
+ * Remove deprecation warnings related to `Relation#all` from Rails 4.
29
+ * Form builder can be used outside the context of a controller [@jasonwebster](https://github.com/jasonwebster)
30
+ * Skip pattern attribute when using `validates_format_of` with `:without` option [@glebm](https://github.com/glebm)
31
+
20
32
  Please check [v2.1](https://github.com/plataformatec/simple_form/blob/v2.1/CHANGELOG.md) for previous changes.
data/README.md CHANGED
@@ -8,13 +8,13 @@ By [Plataformatec](http://plataformatec.com.br/).
8
8
 
9
9
  Rails forms made easy.
10
10
 
11
- **SimpleForm** aims to be as flexible as possible while helping you with powerful components to create
12
- your forms. The basic goal of SimpleForm is to not touch your way of defining the layout, letting
11
+ **Simple Form** aims to be as flexible as possible while helping you with powerful components to create
12
+ your forms. The basic goal of **Simple Form** is to not touch your way of defining the layout, letting
13
13
  you find the better design for your eyes. Most of the DSL was inherited from Formtastic,
14
14
  which we are thankful for and should make you feel right at home.
15
15
 
16
16
  INFO: This README is [also available in a friendly navigable format](http://simple-form.plataformatec.com.br/)
17
- and refers to **SimpleForm** 3.0. For older releases, check the related branch for your version.
17
+ and refers to **Simple Form** 3.0. For older releases, check the related branch for your version.
18
18
 
19
19
  ## Installation
20
20
 
@@ -45,7 +45,7 @@ gem 'country_select'
45
45
 
46
46
  ### Twitter Bootstrap
47
47
 
48
- **SimpleForm** can be easily integrated to the [Twitter Bootstrap](http://twitter.github.com/bootstrap).
48
+ **Simple Form** can be easily integrated to the [Twitter Bootstrap](http://twitter.github.com/bootstrap).
49
49
  To do that you have to use the `bootstrap` option in the install generator, like this:
50
50
 
51
51
  ```console
@@ -59,29 +59,32 @@ For more information see the generator output, our
59
59
  [example application code](https://github.com/rafaelfranca/simple_form-bootstrap) and
60
60
  [the live example app](http://simple-form-bootstrap.plataformatec.com.br/).
61
61
 
62
- **NOTE**: **SimpleForm** integration requires Twitter Bootstrap version 2.0 or higher.
62
+ **NOTE**: **Simple Form** integration requires Twitter Bootstrap version 2.0 or higher.
63
63
 
64
64
  ### Zurb Foundation 3
65
65
 
66
- To generate wrappers that are compatible with [Zurb Foundation 3](http://foundation.zurb.com/), pass the `foundation` option to the generator, like this:
66
+ To generate wrappers that are compatible with [Zurb Foundation 3](http://foundation.zurb.com/), pass
67
+ the `foundation` option to the generator, like this:
67
68
 
68
69
  ```console
69
70
  rails generate simple_form:install --foundation
70
71
  ```
71
72
 
72
- Please note that the Foundation wrapper does not support the `:hint` option by default. In order to enable hints, please uncomment the appropriate line in `config/initializers/simple_form_foundation.rb`. You will need to provide your own CSS styles for hints.
73
+ Please note that the Foundation wrapper does not support the `:hint` option by default. In order to
74
+ enable hints, please uncomment the appropriate line in `config/initializers/simple_form_foundation.rb`.
75
+ You will need to provide your own CSS styles for hints.
73
76
 
74
77
  Please see the [instructions on how to install Foundation in a Rails app](http://foundation.zurb.com/old-docs/f3/rails.php).
75
78
 
76
79
  ## Usage
77
80
 
78
- **SimpleForm** was designed to be customized as you need to. Basically it's a stack of components that
81
+ **Simple Form** was designed to be customized as you need to. Basically it's a stack of components that
79
82
  are invoked to create a complete html input for you, which by default contains label, hints, errors
80
83
  and the input itself. It does not aim to create a lot of different logic from the default Rails
81
- form helpers, as they do a great work by themselves. Instead, **SimpleForm** acts as a DSL and just
84
+ form helpers, as they do a great work by themselves. Instead, **Simple Form** acts as a DSL and just
82
85
  maps your input type (retrieved from the column definition in the database) to a specific helper method.
83
86
 
84
- To start using **SimpleForm** you just have to use the helper it provides:
87
+ To start using **Simple Form** you just have to use the helper it provides:
85
88
 
86
89
  ```erb
87
90
  <%= simple_form_for @user do |f| %>
@@ -144,7 +147,7 @@ overwrite the defaults:
144
147
  <% end %>
145
148
  ```
146
149
 
147
- Since **SimpleForm** generates a wrapper div around your label and input by default, you can pass
150
+ Since **Simple Form** generates a wrapper div around your label and input by default, you can pass
148
151
  any html attribute to that wrapper as well using the `:wrapper_html` option, like so:
149
152
 
150
153
  ```erb
@@ -158,7 +161,9 @@ any html attribute to that wrapper as well using the `:wrapper_html` option, lik
158
161
 
159
162
  Required fields are marked with an * prepended to their labels.
160
163
 
161
- By default all inputs are required. When the form object has `presence` validations attached to its fields, **SimpleForm** tells required and optional fields apart. For performance reasons, this detection is skipped on validations that make use of conditional options, such as `:if` and `:unless`.
164
+ By default all inputs are required. When the form object has `presence` validations attached to its
165
+ fields, **Simple Form** tells required and optional fields apart. For performance reasons, this
166
+ detection is skipped on validations that make use of conditional options, such as `:if` and `:unless`.
162
167
 
163
168
  And of course, the `required` property of any input can be overwritten as needed:
164
169
 
@@ -171,7 +176,7 @@ And of course, the `required` property of any input can be overwritten as needed
171
176
  <% end %>
172
177
  ```
173
178
 
174
- **SimpleForm** also lets you overwrite the default input type it creates:
179
+ **Simple Form** also lets you overwrite the default input type it creates:
175
180
 
176
181
  ```erb
177
182
  <%= simple_form_for @user do |f| %>
@@ -187,7 +192,7 @@ So instead of a checkbox for the *accepts* attribute, you'll have a pair of radi
187
192
  labels and a text area instead of a text field for the description. You can also render boolean
188
193
  attributes using `as: :select` to show a dropdown.
189
194
 
190
- It is also possible to give the `:disabled` option to **SimpleForm**, and it'll automatically mark
195
+ It is also possible to give the `:disabled` option to **Simple Form**, and it'll automatically mark
191
196
  the wrapper as disabled with a css class, so you can style labels, hints and other components inside
192
197
  the wrapper as well:
193
198
 
@@ -198,7 +203,7 @@ the wrapper as well:
198
203
  <% end %>
199
204
  ```
200
205
 
201
- **SimpleForm** accepts same options as their corresponding input type helper in Rails:
206
+ **Simple Form** accepts same options as their corresponding input type helper in Rails:
202
207
 
203
208
  ```erb
204
209
  <%= simple_form_for @user do |f| %>
@@ -209,7 +214,7 @@ the wrapper as well:
209
214
  <% end %>
210
215
  ```
211
216
 
212
- **SimpleForm** also allows you to use label, hint, input_field, error and full_error helpers
217
+ **Simple Form** also allows you to use label, hint, input_field, error and full_error helpers
213
218
  (please take a look at the rdocs for each method for more info):
214
219
 
215
220
  ```erb
@@ -227,12 +232,13 @@ Any extra option passed to these methods will be rendered as html option.
227
232
 
228
233
  ### Stripping away all wrapper divs
229
234
 
230
- **SimpleForm** also allows you to strip away all the div wrappers around the `<input>` field that is generated with the usual `f.input`.
235
+ **Simple Form** also allows you to strip away all the div wrappers around the `<input>` field that is
236
+ generated with the usual `f.input`.
231
237
  The easiest way to achieve this is to use `f.input_field`.
232
238
 
233
239
  Example:
234
240
 
235
- ```erb
241
+ ```ruby
236
242
  simple_form_for @user do |f|
237
243
  f.input_field :name
238
244
  end
@@ -240,7 +246,7 @@ end
240
246
 
241
247
  Produces:
242
248
 
243
- ```erb
249
+ ```html
244
250
  <input class="string required" id="user_name" maxlength="100"
245
251
  name="user[name]" size="100" type="text" value="Carlos" />
246
252
  ```
@@ -262,7 +268,7 @@ overriding the `:collection` option:
262
268
 
263
269
  Collections can be arrays or ranges, and when a `:collection` is given the `:select` input will be
264
270
  rendered by default, so we don't need to pass the `as: :select` option. Other types of collection
265
- are `:radio_buttons` and `:check_boxes`. Those are added by **SimpleForm** to Rails set of form
271
+ are `:radio_buttons` and `:check_boxes`. Those are added by **Simple Form** to Rails set of form
266
272
  helpers (read Extra Helpers session below for more information).
267
273
 
268
274
  Collection inputs accept two other options beside collections:
@@ -294,12 +300,12 @@ used to retrieve label/value attributes for the `option` tags. Besides that, you
294
300
  each group (required)
295
301
 
296
302
  * _group_label_method_ => the label method to be applied on the given collection to retrieve the label
297
- for the _optgroup_ (**SimpleForm** will attempt to guess the best one the same way it does with
303
+ for the _optgroup_ (**Simple Form** will attempt to guess the best one the same way it does with
298
304
  `:label_method`)
299
305
 
300
306
  ### Priority
301
307
 
302
- **SimpleForm** also supports `:time_zone` and `:country`. When using such helpers, you can give
308
+ **Simple Form** also supports `:time_zone` and `:country`. When using such helpers, you can give
303
309
  `:priority` as option to select which time zones and/or countries should be given higher priority:
304
310
 
305
311
  ```ruby
@@ -319,7 +325,7 @@ f.input :shipping_country, priority: [ "Brazil" ], collection: [ "Australia", "B
319
325
 
320
326
  ### Associations
321
327
 
322
- To deal with associations, **SimpleForm** can generate select inputs, a series of radios buttons or check boxes.
328
+ To deal with associations, **Simple Form** can generate select inputs, a series of radios buttons or check boxes.
323
329
  Lets see how it works: imagine you have a user model that belongs to a company and has_and_belongs_to_many
324
330
  roles. The structure would be something like:
325
331
 
@@ -372,9 +378,12 @@ In case you want to declare different labels and values:
372
378
  f.association :company, label_method: :company_name, value_method: :id, include_blank: false
373
379
  ```
374
380
 
381
+ Please note that the association helper is currently only tested with Active Record. It currently
382
+ does not work well with Mongoid and depending on the ORM you're using your mileage may vary.
383
+
375
384
  ### Buttons
376
385
 
377
- All web forms need buttons, right? **SimpleForm** wraps them in the DSL, acting like a proxy:
386
+ All web forms need buttons, right? **Simple Form** wraps them in the DSL, acting like a proxy:
378
387
 
379
388
  ```erb
380
389
  <%= simple_form_for @user do |f| %>
@@ -387,7 +396,7 @@ The above will simply call submit. You choose to use it or not, it's just a ques
387
396
 
388
397
  ### Wrapping Rails Form Helpers
389
398
 
390
- Say you wanted to use a rails form helper but still wrap it in **SimpleForm** goodness? You can, by
399
+ Say you wanted to use a rails form helper but still wrap it in **Simple Form** goodness? You can, by
391
400
  calling input with a block like so:
392
401
 
393
402
  ```erb
@@ -401,12 +410,12 @@ hash of additional attributes for each option.
401
410
 
402
411
  ### Extra helpers
403
412
 
404
- **SimpleForm** also comes with some extra helpers you can use inside rails default forms without relying
413
+ **Simple Form** also comes with some extra helpers you can use inside rails default forms without relying
405
414
  on `simple_form_for` helper. They are listed below.
406
415
 
407
416
  #### Simple Fields For
408
417
 
409
- Wrapper to use **SimpleForm** inside a default rails form. It works in the same way that the `field_for`
418
+ Wrapper to use **Simple Form** inside a default rails form. It works in the same way that the `fields_for`
410
419
  Rails helper, but change the builder to use the `SimpleForm::FormBuilder`.
411
420
 
412
421
  ```ruby
@@ -418,7 +427,6 @@ form_for @user do |f|
418
427
  end
419
428
  ```
420
429
 
421
-
422
430
  #### Collection Radio Buttons
423
431
 
424
432
  Creates a collection of radio inputs with labels associated (same API as `collection_select`):
@@ -465,7 +473,7 @@ end
465
473
 
466
474
  ## Mappings/Inputs available
467
475
 
468
- **SimpleForm** comes with a lot of default mappings:
476
+ **Simple Form** comes with a lot of default mappings:
469
477
 
470
478
  ```text
471
479
  Mapping Input Column Type
@@ -496,7 +504,7 @@ time_zone time zone select string with name matching "t
496
504
 
497
505
  ## Custom inputs
498
506
 
499
- It is very easy to add custom inputs to **SimpleForm**. For instance, if you want to add a custom input
507
+ It is very easy to add custom inputs to **Simple Form**. For instance, if you want to add a custom input
500
508
  that extends the string one, you just need to add this file:
501
509
 
502
510
  ```ruby
@@ -514,7 +522,7 @@ And use it in your views:
514
522
  f.input :money, as: :currency
515
523
  ```
516
524
 
517
- You can also redefine existing **SimpleForm** inputs by creating a new class with the same name. For
525
+ You can also redefine existing **Simple Form** inputs by creating a new class with the same name. For
518
526
  instance, if you want to wrap date/time/datetime in a div, you can do:
519
527
 
520
528
  ```ruby
@@ -539,7 +547,7 @@ end
539
547
 
540
548
  ## Custom form builder
541
549
 
542
- You can create a custom form builder that uses **SimpleForm**.
550
+ You can create a custom form builder that uses **Simple Form**.
543
551
 
544
552
  Create a helper method that calls `simple_form_for` with a custom builder:
545
553
 
@@ -563,7 +571,7 @@ end
563
571
 
564
572
  ## I18n
565
573
 
566
- **SimpleForm** uses all power of I18n API to lookup labels, hints and placeholders. To customize your
574
+ **Simple Form** uses all power of I18n API to lookup labels, hints and placeholders. To customize your
567
575
  forms you can create a locale file like this:
568
576
 
569
577
  ```yaml
@@ -585,7 +593,7 @@ en:
585
593
 
586
594
  And your forms will use this information to render the components for you.
587
595
 
588
- **SimpleForm** also lets you be more specific, separating lookups through actions for labels, hints and
596
+ **Simple Form** also lets you be more specific, separating lookups through actions for labels, hints and
589
597
  placeholders. Let's say you want a different label for new and edit actions, the locale file would
590
598
  be something like:
591
599
 
@@ -601,7 +609,7 @@ en:
601
609
  password: 'Change password'
602
610
  ```
603
611
 
604
- This way **SimpleForm** will figure out the right translation for you, based on the action being
612
+ This way **Simple Form** will figure out the right translation for you, based on the action being
605
613
  rendered. And to be a little bit DRYer with your locale file, you can specify defaults for all
606
614
  models under the 'defaults' key:
607
615
 
@@ -624,24 +632,24 @@ en:
624
632
  password: '****'
625
633
  ```
626
634
 
627
- **SimpleForm** will always look for a default attribute translation under the "defaults" key if no
635
+ **Simple Form** will always look for a default attribute translation under the "defaults" key if no
628
636
  specific is found inside the model key. Note that this syntax is different from 1.x. To migrate to
629
637
  the new syntax, just move "labels.#{attribute}" to "labels.defaults.#{attribute}".
630
638
 
631
- In addition, **SimpleForm** will fallback to default human_attribute_name from Rails when no other
639
+ In addition, **Simple Form** will fallback to default human_attribute_name from Rails when no other
632
640
  translation is found for labels. Finally, you can also overwrite any label, hint or placeholder
633
641
  inside your view, just by passing the option manually. This way the I18n lookup will be skipped.
634
642
 
635
- **SimpleForm** also has support for translating options in collection helpers. For instance, given a
643
+ **Simple Form** also has support for translating options in collection helpers. For instance, given a
636
644
  User with a `:gender` attribute, you might want to create a select box showing translated labels
637
- that would post either `male` or `female` as value. With **SimpleForm** you could create an input
645
+ that would post either `male` or `female` as value. With **Simple Form** you could create an input
638
646
  like this:
639
647
 
640
648
  ```ruby
641
649
  f.input :gender, collection: [:male, :female]
642
650
  ```
643
651
 
644
- And **SimpleForm** will try a lookup like this in your locale file, to find the right labels to show:
652
+ And **Simple Form** will try a lookup like this in your locale file, to find the right labels to show:
645
653
 
646
654
  ```yaml
647
655
  en:
@@ -654,7 +662,7 @@ en:
654
662
  ```
655
663
 
656
664
  You can also use the `defaults` key as you would do with labels, hints and placeholders. It is
657
- important to notice that **SimpleForm** will only do the lookup for options if you give a collection
665
+ important to notice that **Simple Form** will only do the lookup for options if you give a collection
658
666
  composed of symbols only. This is to avoid constant lookups to I18n.
659
667
 
660
668
  It's also possible to translate buttons, using Rails' built-in I18n support:
@@ -697,22 +705,22 @@ en:
697
705
  name: Name
698
706
  ```
699
707
 
700
- This difference exists because **SimpleForm** relies on `object_name` provided by Rails'
708
+ This difference exists because **Simple Form** relies on `object_name` provided by Rails'
701
709
  FormBuilder to determine the translation path for a given object instead of `i18n_key` from the
702
710
  object itself. Thus, similarly, if a form for an `Admin::User` object is defined by calling
703
- `simple_form_for @admin_user, as: :some_user`, **SimpleForm** will look for translations
711
+ `simple_form_for @admin_user, as: :some_user`, **Simple Form** will look for translations
704
712
  under `some_user` instead of `admin_user`.
705
713
 
706
714
  ## Configuration
707
715
 
708
- **SimpleForm** has several configuration options. You can read and change them in the initializer
709
- created by **SimpleForm**, so if you haven't executed the command below yet, please do:
716
+ **Simple Form** has several configuration options. You can read and change them in the initializer
717
+ created by **Simple Form**, so if you haven't executed the command below yet, please do:
710
718
 
711
719
  `rails generate simple_form:install`
712
720
 
713
721
  ### The wrappers API
714
722
 
715
- With **SimpleForm** you can configure how your components will be rendered using the wrappers API.
723
+ With **Simple Form** you can configure how your components will be rendered using the wrappers API.
716
724
  The syntax looks like this:
717
725
 
718
726
  ```ruby
@@ -733,7 +741,8 @@ config.wrappers tag: :div, class: :input,
733
741
  end
734
742
  ```
735
743
 
736
- The _Form components_ will generate the form tags like labels, inputs, hints or errors contents. The available components are:
744
+ The _Form components_ will generate the form tags like labels, inputs, hints or errors contents.
745
+ The available components are:
737
746
 
738
747
  ```ruby
739
748
  :label # The <label> tag alone
@@ -811,7 +820,7 @@ simple_form_for @user do |f|
811
820
  end
812
821
  ```
813
822
 
814
- **SimpleForm** also allows you to use optional elements. For instance, let's suppose you want to use
823
+ **Simple Form** also allows you to use optional elements. For instance, let's suppose you want to use
815
824
  hints or placeholders, but you don't want them to be generated automatically. You can set their
816
825
  default values to `false` or use the `optional` method. Is preferable to use the `optional` syntax:
817
826
 
@@ -831,7 +840,7 @@ The same for placeholder.
831
840
 
832
841
  ## HTML 5 Notice
833
842
 
834
- By default, **SimpleForm** will generate input field types and attributes that are supported in HTML5,
843
+ By default, **Simple Form** will generate input field types and attributes that are supported in HTML5,
835
844
  but are considered invalid HTML for older document types such as HTML4 or XHTML1.0. The HTML5
836
845
  extensions include the new field types such as email, number, search, url, tel, and the new
837
846
  attributes such as required, autofocus, maxlength, min, max, step.
@@ -841,7 +850,7 @@ required attribute to force a value into an input and will prevent form submissi
841
850
  Depending on the design of the application this may or may not be desired. In many cases it can
842
851
  break existing UI's.
843
852
 
844
- It is possible to disable all HTML 5 extensions in **SimpleForm** with the following configuration:
853
+ It is possible to disable all HTML 5 extensions in **Simple Form** with the following configuration:
845
854
 
846
855
  ```ruby
847
856
  SimpleForm.html5 = false # default is true
@@ -864,11 +873,11 @@ You can also add `novalidate` to a specific form by setting the option on the fo
864
873
  <%= simple_form_for(resource, html: {novalidate: true}) do |form| %>
865
874
  ```
866
875
 
867
- Please notice that any of the configurations above will disable the `placeholder` component,
876
+ Please notice that any of the configurations above will not disable the `placeholder` component,
868
877
  which is an HTML 5 feature. We believe most of the newest browsers are handling this attribute fine,
869
878
  and if they aren't, any plugin you use would take of using the placeholder attribute to do it.
870
879
  However, you can disable it if you want, by removing the placeholder component from the components
871
- list in **SimpleForm** configuration file.
880
+ list in **Simple Form** configuration file.
872
881
 
873
882
  ## Information
874
883
 
@@ -881,11 +890,11 @@ http://groups.google.com/group/plataformatec-simpleform
881
890
 
882
891
  ### RDocs
883
892
 
884
- You can view the **SimpleForm** documentation in RDoc format here:
893
+ You can view the **Simple Form** documentation in RDoc format here:
885
894
 
886
895
  http://rubydoc.info/github/plataformatec/simple_form/master/frames
887
896
 
888
- If you need to use **SimpleForm** with Rails 2.3, you can always run `gem server` from the command line
897
+ If you need to use **Simple Form** with Rails 2.3, you can always run `gem server` from the command line
889
898
  after you install the gem to access the old documentation.
890
899
 
891
900
  ### Bug reports
@@ -907,4 +916,5 @@ https://github.com/plataformatec/simple_form/issues
907
916
 
908
917
  MIT License. Copyright 2009-2013 Plataformatec. http://plataformatec.com.br
909
918
 
910
- You are not granted rights or licenses to the trademarks of the Plataformatec, including without limitation the Simple Form name or logo.
919
+ You are not granted rights or licenses to the trademarks of the Plataformatec, including without
920
+ limitation the Simple Form name or logo.
@@ -139,4 +139,7 @@ SimpleForm.setup do |config|
139
139
 
140
140
  # Cache SimpleForm inputs discovery
141
141
  # config.cache_discovery = !Rails.env.development?
142
+
143
+ # Default class for inputs
144
+ # config.input_class = nil
142
145
  end
@@ -12,7 +12,7 @@ module SimpleForm
12
12
  protected
13
13
 
14
14
  def error_text
15
- "#{options[:error_prefix]} #{errors.send(error_method)}".lstrip.html_safe
15
+ "#{html_escape(options[:error_prefix])} #{errors.send(error_method)}".lstrip.html_safe
16
16
  end
17
17
 
18
18
  def error_method
@@ -5,8 +5,13 @@ module SimpleForm
5
5
  def hint
6
6
  @hint ||= begin
7
7
  hint = options[:hint]
8
- hint_content = hint.is_a?(String) ? hint : translate(:hints)
9
- hint_content.html_safe if hint_content
8
+
9
+ if hint.is_a?(String)
10
+ html_escape(hint)
11
+ else
12
+ content = translate(:hints)
13
+ content.html_safe if content
14
+ end
10
15
  end
11
16
  end
12
17
 
@@ -30,7 +30,7 @@ module SimpleForm
30
30
  end
31
31
 
32
32
  def label_text
33
- SimpleForm.label_text.call(raw_label_text, required_label_text).strip.html_safe
33
+ SimpleForm.label_text.call(html_escape(raw_label_text), required_label_text).strip.html_safe
34
34
  end
35
35
 
36
36
  def label_target
@@ -12,6 +12,8 @@ module SimpleForm
12
12
  update: :edit
13
13
  }
14
14
 
15
+ ATTRIBUTE_COMPONENTS = [:html5, :min_max, :maxlength, :placeholder, :pattern, :readonly]
16
+
15
17
  extend MapType
16
18
  include SimpleForm::Inputs
17
19
 
@@ -135,10 +137,10 @@ module SimpleForm
135
137
  #
136
138
  def input_field(attribute_name, options={})
137
139
  options = options.dup
138
- options[:input_html] = options.except(:as, :collection, :label_method, :value_method)
140
+ options[:input_html] = options.except(:as, :collection, :label_method, :value_method, *ATTRIBUTE_COMPONENTS)
139
141
  options = @defaults.deep_dup.deep_merge(options) if @defaults
140
142
 
141
- SimpleForm::Wrappers::Root.new([:min_max, :maxlength, :placeholder, :pattern, :readonly, :input], wrapper: false).render find_input(attribute_name, options)
143
+ SimpleForm::Wrappers::Root.new(ATTRIBUTE_COMPONENTS + [:input], wrapper: false).render find_input(attribute_name, options)
142
144
  end
143
145
 
144
146
  # Helper for dealing with association selects/radios, generating the
@@ -167,6 +169,8 @@ module SimpleForm
167
169
  #
168
170
  # From the options above, only :collection can also be supplied.
169
171
  #
172
+ # Please note that the association helper is currently only tested with Active Record. Depending on the ORM you are using your mileage may vary.
173
+ #
170
174
  def association(association, options={}, &block)
171
175
  options = options.dup
172
176
 
@@ -180,7 +184,9 @@ module SimpleForm
180
184
 
181
185
  options[:as] ||= :select
182
186
  options[:collection] ||= options.fetch(:collection) {
183
- reflection.klass.where(reflection.options[:conditions]).order(reflection.options[:order]).to_a
187
+ conditions = reflection.options[:conditions]
188
+ conditions = conditions.call if conditions.respond_to?(:call)
189
+ reflection.klass.where(conditions).order(reflection.options[:order])
184
190
  }
185
191
 
186
192
  attribute = case reflection.macro
@@ -446,7 +452,7 @@ module SimpleForm
446
452
  def lookup_model_names #:nodoc:
447
453
  @lookup_model_names ||= begin
448
454
  child_index = options[:child_index]
449
- names = object_name.to_s.scan(/([a-zA-Z_]+)/).flatten
455
+ names = object_name.to_s.scan(/(?!\d)\w+/).flatten
450
456
  names.delete(child_index) if child_index
451
457
  names.each { |name| name.gsub!('_attributes', '') }
452
458
  names.freeze
@@ -1,8 +1,11 @@
1
1
  require 'simple_form/i18n_cache'
2
+ require 'active_support/core_ext/string/output_safety'
2
3
 
3
4
  module SimpleForm
4
5
  module Inputs
5
6
  class Base
7
+ include ERB::Util
8
+
6
9
  extend I18nCache
7
10
 
8
11
  include SimpleForm::Helpers::Autofocus
@@ -65,6 +68,10 @@ module SimpleForm
65
68
  @html_classes = SimpleForm.additional_classes_for(:input) { additional_classes }
66
69
 
67
70
  @input_html_classes = @html_classes.dup
71
+ if SimpleForm.input_class && !input_html_classes.empty?
72
+ input_html_classes << SimpleForm.input_class
73
+ end
74
+
68
75
  @input_html_options = html_options_for(:input, input_html_classes).tap do |o|
69
76
  o[:readonly] = true if has_readonly?
70
77
  o[:disabled] = true if has_disabled?
@@ -17,6 +17,7 @@ module SimpleForm
17
17
  input
18
18
  elsif nested_boolean_style?
19
19
  html_options = label_html_options.dup
20
+ html_options[:class] ||= []
20
21
  html_options[:class].push(:checkbox)
21
22
 
22
23
  build_hidden_field_for_checkbox +
@@ -66,7 +66,7 @@ module SimpleForm
66
66
  collection_translated = translate_collection if collection_classes == [Symbol]
67
67
 
68
68
  if collection_translated || collection_classes.include?(Array)
69
- { label: :first, value: :last }
69
+ { label: :first, value: :second }
70
70
  elsif collection_includes_basic_objects?(collection_classes)
71
71
  { label: :to_s, value: :to_s }
72
72
  else
@@ -11,7 +11,7 @@ module SimpleForm
11
11
  position = case input_type
12
12
  when :date, :datetime
13
13
  date_order = input_options[:order] || I18n.t('date.order')
14
- date_order.first
14
+ date_order.first.to_sym
15
15
  else
16
16
  :hour
17
17
  end
@@ -11,8 +11,9 @@ module SimpleForm
11
11
  value = value_for_collection(item, @value_method)
12
12
  text = value_for_collection(item, @text_method)
13
13
  default_html_options = default_html_options_for_collection(item, value)
14
+ additional_html_options = option_html_attributes(item)
14
15
 
15
- rendered_item = yield item, value, text, default_html_options
16
+ rendered_item = yield item, value, text, default_html_options.merge(additional_html_options)
16
17
 
17
18
  item_wrapper_tag ? @template_object.content_tag(item_wrapper_tag, rendered_item, class: item_wrapper_class) : rendered_item
18
19
  end.join.html_safe
@@ -1,3 +1,3 @@
1
1
  module SimpleForm
2
- VERSION = "3.0.0.rc".freeze
2
+ VERSION = "3.0.1".freeze
3
3
  end
data/lib/simple_form.rb CHANGED
@@ -147,6 +147,10 @@ module SimpleForm
147
147
  html_tag
148
148
  end
149
149
 
150
+ # Adds a class to each generated inputs
151
+ mattr_accessor :input_class
152
+ @@input_class = nil
153
+
150
154
  ## WRAPPER CONFIGURATION
151
155
  # The default wrapper to be used by the FormBuilder.
152
156
  mattr_accessor :default_wrapper
@@ -49,8 +49,7 @@ class BuilderTest < ActionView::TestCase
49
49
  end
50
50
 
51
51
  test "collection radio checks the correct value to local variables" do
52
- user = User.new
53
- user.active = false
52
+ user = User.build(active: false)
54
53
  with_collection_radio_buttons user, :active, [true, false], :to_s, :to_s
55
54
 
56
55
  assert_select 'form input[type=radio][value=true]'
@@ -297,9 +296,9 @@ class BuilderTest < ActionView::TestCase
297
296
  end
298
297
 
299
298
  test "collection check box checks the correct value to local variables" do
300
- user = User.new
301
- user.tag_ids = [1, 3]
299
+ user = User.build(tag_ids: [1, 3])
302
300
  collection = (1..3).map { |i| [i, "Tag #{i}"] }
301
+
303
302
  with_collection_check_boxes user, :tag_ids, collection, :first, :last
304
303
 
305
304
  assert_select 'form input[type=checkbox][value=1][checked=checked]'
@@ -105,6 +105,14 @@ class AssociationTest < ActionView::TestCase
105
105
  assert_select 'form input.radio_buttons#user_company_id_3'
106
106
  end
107
107
 
108
+ test 'builder allows collection to have a proc as a condition' do
109
+ with_association_for @user, :extra_special_company
110
+ assert_select 'form select.select#user_extra_special_company_id'
111
+ assert_select 'form select option[value=1]'
112
+ assert_no_select 'form select option[value=2]'
113
+ assert_no_select 'form select option[value=3]'
114
+ end
115
+
108
116
  test 'builder marks the record which already belongs to the user' do
109
117
  @user.company_id = 2
110
118
  with_association_for @user, :company, as: :radio_buttons
@@ -80,8 +80,13 @@ class ErrorTest < ActionView::TestCase
80
80
  assert_no_select 'p.error[error_method]'
81
81
  end
82
82
 
83
- test 'error should generate an error message with raw HTML tags' do
83
+ test 'error should escape error prefix text' do
84
84
  with_error_for @user, :name, error_prefix: '<b>Name</b>'
85
+ assert_select 'span.error', "&lt;b&gt;Name&lt;/b&gt; can't be blank"
86
+ end
87
+
88
+ test 'error should generate an error message with raw HTML tags' do
89
+ with_error_for @user, :name, error_prefix: '<b>Name</b>'.html_safe
85
90
  assert_select 'span.error', "Name can't be blank"
86
91
  assert_select 'span.error b', "Name"
87
92
  end
@@ -87,6 +87,19 @@ class FormBuilderTest < ActionView::TestCase
87
87
  end
88
88
  end
89
89
 
90
+ test 'builder allow to use numbers in the model name' do
91
+ user = UserNumber1And2.build(tags: [Tag.new(nil, 'Tag1')])
92
+
93
+ with_concat_form_for(user, url: '/') do |f|
94
+ f.simple_fields_for(:tags) do |tags|
95
+ tags.input :name
96
+ end
97
+ end
98
+
99
+ assert_select 'form .user_number1_and2_tags_name'
100
+ assert_no_select 'form .user_number1_and2_tags_1_name'
101
+ end
102
+
90
103
  # INPUT TYPES
91
104
  test 'builder should generate text fields for string columns' do
92
105
  with_form_for @user, :name
@@ -43,8 +43,14 @@ class HintTest < ActionView::TestCase
43
43
  end
44
44
 
45
45
  test 'hint should be output as html_safe' do
46
- with_hint_for @user, :name, hint: '<b>Bold</b> and not...'
46
+ with_hint_for @user, :name, hint: '<b>Bold</b> and not...'.html_safe
47
47
  assert_select 'span.hint', 'Bold and not...'
48
+ assert_select 'span.hint b', 'Bold'
49
+ end
50
+
51
+ test 'builder should escape hint text' do
52
+ with_hint_for @user, :name, hint: '<script>alert(1337)</script>'
53
+ assert_select 'span.hint', "&lt;script&gt;alert(1337)&lt;/script&gt;"
48
54
  end
49
55
 
50
56
  # Without attribute name
@@ -132,7 +138,7 @@ class HintTest < ActionView::TestCase
132
138
  test 'hint with custom wrappers works' do
133
139
  swap_wrapper do
134
140
  with_hint_for @user, :name, hint: "can't be blank"
135
- assert_select 'div.omg_hint', "can't be blank"
141
+ assert_select 'div.omg_hint', "can&#39;t be blank"
136
142
  end
137
143
  end
138
144
  end
@@ -21,6 +21,23 @@ class InputFieldTest < ActionView::TestCase
21
21
  assert_select 'textarea#user_name.text'
22
22
  end
23
23
 
24
+ test 'builder input_field should generate input type based on column type' do
25
+ with_concat_form_for(@user) do |f|
26
+ f.input_field :age
27
+ end
28
+
29
+ assert_select 'input[type=number].integer#user_age'
30
+ end
31
+
32
+ test 'builder input_field should be able to disable any component' do
33
+ with_concat_form_for(@user) do |f|
34
+ f.input_field :age, html5: false
35
+ end
36
+
37
+ assert_no_select 'input[html5=false]#user_age'
38
+ assert_select 'input[type=text].integer#user_age'
39
+ end
40
+
24
41
  test 'builder input_field should allow passing options to input tag' do
25
42
  with_concat_form_for(@user) do |f|
26
43
  f.input_field :name, id: 'name_input', class: 'name'
@@ -19,7 +19,7 @@ class LabelTest < ActionView::TestCase
19
19
  assert_no_select 'label[as=boolean]'
20
20
  end
21
21
 
22
- test 'builder should generate a label componet tag with a clean HTML' do
22
+ test 'builder should generate a label component tag with a clean HTML' do
23
23
  with_label_for @user, :name
24
24
  assert_no_select 'label.string[label_html]'
25
25
  end
@@ -29,6 +29,16 @@ class LabelTest < ActionView::TestCase
29
29
  assert_select 'label.string.required[for=validating_user_name]', /Name/
30
30
  end
31
31
 
32
+ test 'builder should escape label text' do
33
+ with_label_for @user, :name, label: '<script>alert(1337)</script>', required: false
34
+ assert_select 'label.string', "&lt;script&gt;alert(1337)&lt;/script&gt;"
35
+ end
36
+
37
+ test 'builder should not escape label text if it is safe' do
38
+ with_label_for @user, :name, label: '<script>alert(1337)</script>'.html_safe, required: false
39
+ assert_select 'label.string script', "alert(1337)"
40
+ end
41
+
32
42
  test 'builder should allow passing options to label tag' do
33
43
  with_label_for @user, :name, label: 'My label', id: 'name_label'
34
44
  assert_select 'label.string#name_label', /My label/
@@ -137,4 +137,16 @@ class BooleanInputTest < ActionView::TestCase
137
137
  end
138
138
  end
139
139
  end
140
+
141
+ test 'input boolean without additional classes should add "checkbox" class to label' do
142
+ swap_wrapper :default, self.custom_wrapper_without_top_level do
143
+ swap SimpleForm, boolean_style: :nested, generate_additional_classes_for: [:input] do
144
+ with_input_for @user, :active, :boolean
145
+
146
+ assert_select 'label'
147
+ assert_select 'label.checkbox'
148
+ assert_no_select 'label.boolean'
149
+ end
150
+ end
151
+ end
140
152
  end
@@ -60,6 +60,11 @@ class CollectionCheckBoxesInputTest < ActionView::TestCase
60
60
  assert_no_select 'form ul'
61
61
  end
62
62
 
63
+ test 'input check boxes accepts html options as the last element of collection' do
64
+ with_input_for @user, :name, :check_boxes, collection: [['Jose', 'jose', class: 'foo']]
65
+ assert_select 'input.foo[type=checkbox][value=jose]'
66
+ end
67
+
63
68
  test 'input check boxes wraps the collection in the configured collection wrapper tag' do
64
69
  swap SimpleForm, collection_wrapper_tag: :ul do
65
70
  with_input_for @user, :active, :check_boxes
@@ -82,6 +82,11 @@ class CollectionRadioButtonsInputTest < ActionView::TestCase
82
82
  assert_select 'input[type=radio][value=Carlos][checked=checked]'
83
83
  end
84
84
 
85
+ test 'input should accept html options as the last element of collection' do
86
+ with_input_for @user, :name, :radio_buttons, collection: [['Jose', 'jose', class: 'foo']]
87
+ assert_select 'input.foo[type=radio][value=jose]'
88
+ end
89
+
85
90
  test 'input should allow using a collection with text/value arrays' do
86
91
  with_input_for @user, :name, :radio_buttons, collection: [['Jose', 'jose'], ['Carlos', 'carlos']]
87
92
  assert_select 'input[type=radio][value=jose]'
@@ -56,6 +56,12 @@ class CollectionSelectInputTest < ActionView::TestCase
56
56
  assert_select 'select option[selected=selected]', 'Carlos'
57
57
  end
58
58
 
59
+ test 'input should accept html options as the last element of collection' do
60
+ with_input_for @user, :name, :select, collection: [['Jose', class: 'foo']]
61
+ assert_select 'select.select#user_name'
62
+ assert_select 'select option.foo', 'Jose'
63
+ end
64
+
59
65
  test 'input should mark the selected value also when using integers' do
60
66
  @user.age = 18
61
67
  with_input_for @user, :age, :select, collection: 18..60
@@ -112,7 +118,7 @@ class CollectionSelectInputTest < ActionView::TestCase
112
118
  end
113
119
 
114
120
  test 'input should detect label and value on collections' do
115
- users = [ setup_new_user(id: 1, name: "Jose"), setup_new_user(id: 2, name: "Carlos") ]
121
+ users = [User.build(id: 1, name: "Jose"), User.build(id: 2, name: "Carlos")]
116
122
  with_input_for @user, :description, :select, collection: users
117
123
  assert_select 'select option[value=1]', 'Jose'
118
124
  assert_select 'select option[value=2]', 'Carlos'
@@ -63,26 +63,26 @@ class DateTimeInputTest < ActionView::TestCase
63
63
  end
64
64
 
65
65
  test 'label should use i18n to get target for date input type' do
66
- store_translations(:en, date: { order: [:month, :day, :year] }) do
66
+ store_translations(:en, date: { order: ['month', 'day', 'year'] }) do
67
67
  with_input_for :project, :created_at, :date
68
68
  assert_select 'label[for=project_created_at_2i]'
69
69
  end
70
70
  end
71
71
 
72
72
  test 'label should use i18n to get target for datetime input type' do
73
- store_translations(:en, date: { order: [:month, :day, :year] }) do
73
+ store_translations(:en, date: { order: ['month', 'day', 'year'] }) do
74
74
  with_input_for :project, :created_at, :datetime
75
75
  assert_select 'label[for=project_created_at_2i]'
76
76
  end
77
77
  end
78
78
 
79
79
  test 'label should use order to get target when date input type' do
80
- with_input_for :project, :created_at, :date, order: [:month, :year, :day]
80
+ with_input_for :project, :created_at, :date, order: ['month', 'year', 'day']
81
81
  assert_select 'label[for=project_created_at_2i]'
82
82
  end
83
83
 
84
84
  test 'label should use order to get target when datetime input type' do
85
- with_input_for :project, :created_at, :datetime, order: [:month, :year, :day]
85
+ with_input_for :project, :created_at, :datetime, order: ['month', 'year', 'day']
86
86
  assert_select 'label[for=project_created_at_2i]'
87
87
  end
88
88
 
@@ -20,6 +20,22 @@ class InputTest < ActionView::TestCase
20
20
  assert_select 'input.string[autofocus]'
21
21
  end
22
22
 
23
+ test 'input accepts input_class configuration' do
24
+ swap SimpleForm, input_class: :xlarge do
25
+ with_input_for @user, :name, :string
26
+ assert_select 'input.xlarge'
27
+ assert_no_select 'div.xlarge'
28
+ end
29
+ end
30
+
31
+ test 'input does not add input_class when configured to not generate additional classes for input' do
32
+ swap SimpleForm, input_class: 'xlarge', generate_additional_classes_for: [:wrapper] do
33
+ with_input_for @user, :name, :string
34
+ assert_select 'input'
35
+ assert_no_select '.xlarge'
36
+ end
37
+ end
38
+
23
39
  test 'text input should generate autofocus attribute when autofocus option is true' do
24
40
  with_input_for @user, :description, :text, autofocus: true
25
41
  assert_select 'textarea.text[autofocus]'
@@ -130,4 +130,17 @@ class GroupedCollectionSelectInputTest < ActionView::TestCase
130
130
  end
131
131
  end
132
132
  end
133
+
134
+ test 'grouped collection should accept html options as the last element of collection' do
135
+ with_input_for @user, :tag_ids, :grouped_select,
136
+ collection: [['Authors', [['Jose', 'jose', class: 'foo'], ['Carlos', 'carlos', class: 'bar']]]],
137
+ group_method: :last
138
+
139
+ assert_select 'select.grouped_select#user_tag_ids' do
140
+ assert_select 'optgroup[label=Authors]' do
141
+ assert_select 'option.foo', 'Jose'
142
+ assert_select 'option.bar', 'Carlos'
143
+ end
144
+ end
145
+ end
133
146
  end
@@ -52,7 +52,19 @@ class User
52
52
  :description, :created_at, :updated_at, :credit_limit, :password, :url,
53
53
  :delivery_time, :born_at, :special_company_id, :country, :tags, :tag_ids,
54
54
  :avatar, :home_picture, :email, :status, :residence_country, :phone_number,
55
- :post_count, :lock_version, :amount, :attempts, :action, :credit_card, :gender
55
+ :post_count, :lock_version, :amount, :attempts, :action, :credit_card, :gender,
56
+ :extra_special_company_id
57
+
58
+ def self.build(extra_attributes = {})
59
+ attributes = {
60
+ id: 1,
61
+ name: 'New in SimpleForm!',
62
+ description: 'Hello!',
63
+ created_at: Time.now
64
+ }.merge! extra_attributes
65
+
66
+ new attributes
67
+ end
56
68
 
57
69
  def initialize(options={})
58
70
  @new_record = false
@@ -119,6 +131,8 @@ class User
119
131
  Association.new(Company, association, :has_one, {})
120
132
  when :special_company
121
133
  Association.new(Company, association, :belongs_to, { conditions: { id: 1 } })
134
+ when :extra_special_company
135
+ Association.new(Company, association, :belongs_to, { conditions: proc { { id: 1 } } })
122
136
  end
123
137
  end
124
138
 
@@ -215,3 +229,6 @@ class HashBackedAuthor < Hash
215
229
  'hash backed author'
216
230
  end
217
231
  end
232
+
233
+ class UserNumber1And2 < User
234
+ end
data/test/test_helper.rb CHANGED
@@ -35,40 +35,27 @@ class ActionView::TestCase
35
35
  include SimpleForm::ActionViewExtensions::FormHelper
36
36
 
37
37
  setup :set_controller
38
- setup :setup_new_user
38
+ setup :setup_users
39
39
 
40
40
  def set_controller
41
41
  @controller = MockController.new
42
42
  end
43
43
 
44
- def setup_new_user(options={})
45
- @user = User.new({
46
- id: 1,
47
- name: 'New in SimpleForm!',
48
- description: 'Hello!',
49
- created_at: Time.now
50
- }.merge(options))
51
-
52
- @validating_user = ValidatingUser.new({
53
- id: 1,
54
- name: 'New in SimpleForm!',
55
- description: 'Hello!',
44
+ def setup_users(extra_attributes = {})
45
+ @user = User.build(extra_attributes)
46
+
47
+ @validating_user = ValidatingUser.build({
56
48
  home_picture: 'Home picture',
57
- created_at: Time.now,
58
49
  age: 19,
59
50
  amount: 15,
60
51
  attempts: 1,
61
52
  company: [1]
62
- }.merge(options))
53
+ }.merge!(extra_attributes))
63
54
 
64
- @other_validating_user = OtherValidatingUser.new({
65
- id: 1,
66
- name: 'New in SimpleForm!',
67
- description: 'Hello!',
68
- created_at: Time.now,
55
+ @other_validating_user = OtherValidatingUser.build({
69
56
  age: 19,
70
57
  company: 1
71
- }.merge(options))
58
+ }.merge!(extra_attributes))
72
59
  end
73
60
 
74
61
  def protect_against_forgery?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.rc
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Valim
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-05-10 00:00:00.000000000 Z
13
+ date: 2013-11-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activemodel
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 4.0.0.rc1
21
+ version: 4.0.0
22
22
  - - <
23
23
  - !ruby/object:Gem::Version
24
24
  version: '4.1'
@@ -28,7 +28,7 @@ dependencies:
28
28
  requirements:
29
29
  - - '>='
30
30
  - !ruby/object:Gem::Version
31
- version: 4.0.0.rc1
31
+ version: 4.0.0
32
32
  - - <
33
33
  - !ruby/object:Gem::Version
34
34
  version: '4.1'
@@ -38,7 +38,7 @@ dependencies:
38
38
  requirements:
39
39
  - - '>='
40
40
  - !ruby/object:Gem::Version
41
- version: 4.0.0.rc1
41
+ version: 4.0.0
42
42
  - - <
43
43
  - !ruby/object:Gem::Version
44
44
  version: '4.1'
@@ -48,7 +48,7 @@ dependencies:
48
48
  requirements:
49
49
  - - '>='
50
50
  - !ruby/object:Gem::Version
51
- version: 4.0.0.rc1
51
+ version: 4.0.0
52
52
  - - <
53
53
  - !ruby/object:Gem::Version
54
54
  version: '4.1'
@@ -172,12 +172,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  requirements:
175
- - - '>'
175
+ - - '>='
176
176
  - !ruby/object:Gem::Version
177
- version: 1.3.1
177
+ version: '0'
178
178
  requirements: []
179
179
  rubyforge_project: simple_form
180
- rubygems_version: 2.0.3
180
+ rubygems_version: 2.1.11
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: Forms made easy!