Commit Graph

17 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
Daniel Evans b1da0744dd Use symbols instead of strings for #send 2015-08-01 00:57:20 -06:00
Rafael Mendonça França 15f0101545 Pass the options hash instead of the Leaf object
Right now we only care about the options so lets make the code simpler
2014-03-11 19:41:25 -03:00
Rafael Mendonça França e9384fb4bd Whitespaces 2014-03-11 19:13:59 -03:00
Rafael Mendonça França 4a13b2f99c Move the context check down to the method 2014-03-11 16:39:24 -03:00
Rafael Mendonça França 3992cfc57d Extract the wrapper options merge behavior to their own module
This make easier to share the same behavior between all the components
2014-03-11 16:33:51 -03:00
Rafael Mendonça França 44f22ca3fb Make context optional
We plan to make it required in the future but it is optional now to make
easier to implement backwards compatibility
2014-03-11 15:22:45 -03:00
Rafael Mendonça França df47a8599d Merge the context options with the input options 2014-03-11 10:30:49 -03:00
Rafael Mendonça França 645988a855 Pass the context when rendering the component 2014-03-10 18:41:36 -03:00
Erich Kist e8e1973d17 Merge branch 'master' into kb-ek-change-wraper-collection
Conflicts:
	CHANGELOG.md
	lib/simple_form/tags.rb
2013-12-09 11:11:42 -02:00
Luiz HD Costa 8cbe943521 Allow not including input wrapper class
There could be faulty behavior when setting checkbox or radio class
to the input wrapper, as in Bootstrap 3.

Fixes #930
2013-11-26 21:01:16 -02:00
Erich Kist 82d91adf93 CollectionInput will always use item_wrapper_tag 2013-11-26 20:53:51 -02:00
Vasiliy Ermolovich b318d34282 Hash#fetch FTW 2012-02-25 00:17:56 +03: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 b21e3c57e6 Force :label as item wrapper tag when using nested boolean config
Use original config for backwards compatibility, and force label as item
wrapper tag in collection radio buttons / check boxes when using nested
boolean, to match boostrap requirements.
2012-01-27 17:47:48 -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