Commit Graph

10 Commits

Author SHA1 Message Date
Dillon Welch cac943e891 Add frozen_string_literal in all .rb files
I noticed these files all had strings such as "", "  ", "_" that were
allocated each time some common methods were called, over 1000x on a
page in my app. This comment freezes all of these strings such that
they're only allocated once, saving many KB of memory allocation.
2017-11-27 17:06:18 -08:00
Carlos Antonio da Silva e9bb32838b Bring the same concept of "Builder" to collection radio buttons/check boxes
This increases flexibility allowing us to yield only the builder to the
user and hiding specific details of the implementation inside it, also
reusing arguments we already know, such as attribute name and value.

This commit also adds the ability to access the current object/item in
the given collection within the builder instance, giving extra
flexibility to generate custom attributes to label/radio buttons/check
boxes.

Besides, this will make it easy for us to migrate to Rails 4 later as we
are sticking with the same concept here.
2012-02-13 23:57:56 -02:00
Carlos Antonio da Silva cdaf562a7c Refactor building nested style item tags 2012-01-27 17:49:09 -02:00
Carlos Antonio da Silva 26f3c20f1a :radio is not :radio_buttons
Makes the API more consistent with :check_boxes, and improves
compatibility with bootstrap collections by avoiding :radio namespace
collision.
2012-01-27 17:47:48 -02:00
Carlos Antonio da Silva f73e0facc6 Improve compatibility with bootstrap collections - radio buttons / check boxes
Add :item_wrapper_class option to collection helpers and SimpleForm
itself.
2012-01-27 17:44:14 -02:00
Carlos Antonio da Silva 0b34519df2 Do not generate hidden check box field when using nested boolean style
It is considered invalid markup in HTML5. This will only work in
Rails > 3.2.1 (not released at this time). If you really care that much
about this, please use Rails 3-2-stable branch for now, that contains a
backported fix from master.

Backport commit: 2e5ec3b399
More info in #215
2012-01-27 10:50:45 -02:00
Carlos Antonio da Silva 479306e846 More cleanup between radio and check boxes inputs 2012-01-26 17:18:12 -02:00
Carlos Antonio da Silva c2e1272d8c Inherit collection check boxes from radio 2012-01-26 17:11:10 -02:00
Carlos Antonio da Silva 3669bce6cf Rename *CollectionInput to *CollectionSelectInput 2012-01-26 17:00:56 -02:00
Carlos Antonio da Silva 85612cb9e9 Split collection radio/check boxes in different components 2012-01-26 16:53:16 -02:00