Skip to content
This repository

Bootstrap 2.0 changes #47

Closed
wants to merge 10 commits into from

4 participants

Dieter Lunn Stephen Touset Troex Nevelin Matt Hink
Dieter Lunn

Bootstrap 2.0 changed the actions class from 'actions' to 'form-actions'

Stephen Touset
Owner

I'm planning to do a full 2.0 compatibility rewrite this weekend. Will take a look at the changes then. Thanks!

Troex Nevelin

There are a lot of yummy things in 2.0. I'll be waiting for commits and test them. @coder2000 and co patches work well for me.

Stephen Touset
Owner

2.0 changes are in the bootstrap-2.0 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
26 lib/twitter_bootstrap_form_for/form_builder.rb
@@ -39,10 +39,10 @@ def inputs(legend = nil, options = {}, &block)
39 39 # inside of here, and will not look correct unless they are.
40 40 #
41 41 def toggles(label = nil, &block)
42   - template.content_tag(:div, :class => 'clearfix') do
43   - template.concat template.content_tag(:label, label)
44   - template.concat template.content_tag(:div, :class => "input") {
45   - template.content_tag(:ul, :class => "inputs-list") { block.call }
  42 + template.content_tag(:div, :class => 'control-group') do
  43 + template.concat template.content_tag(:label, label, :class => 'control-label')
  44 + template.concat template.content_tag(:div, :class => "controls") {
  45 + block.call
46 46 }
47 47 end
48 48 end
@@ -51,7 +51,7 @@ def toggles(label = nil, &block)
51 51 # Wraps action buttons into their own styled container.
52 52 #
53 53 def actions(&block)
54   - template.content_tag(:div, :class => 'actions', &block)
  54 + template.content_tag(:div, :class => 'form-actions', &block)
55 55 end
56 56
57 57 #
@@ -59,7 +59,7 @@ def actions(&block)
59 59 # button.
60 60 #
61 61 def submit(value = nil, options = {})
62   - options[:class] ||= 'btn primary'
  62 + options[:class] ||= 'btn btn-primary'
63 63
64 64 super value, options
65 65 end
@@ -69,9 +69,9 @@ def submit(value = nil, options = {})
69 69 # to the supplied block.
70 70 #
71 71 def inline(label = nil, &block)
72   - template.content_tag(:div, :class => 'clearfix') do
73   - template.concat template.content_tag(:label, label) if label.present?
74   - template.concat template.content_tag(:div, :class => 'input') {
  72 + template.content_tag(:div, :class => 'control-group') do
  73 + template.concat template.content_tag(:label, label, :class => 'control-label') if label.present?
  74 + template.concat template.content_tag(:div, :class => 'controls') {
75 75 template.content_tag(:div, :class => 'inline-inputs') do
76 76 template.fields_for(
77 77 self.object_name,
@@ -88,7 +88,7 @@ def inline(label = nil, &block)
88 88 define_method input do |attribute, *args, &block|
89 89 options = args.extract_options!
90 90 label = args.first.nil? ? '' : args.shift
91   - classes = [ 'input' ]
  91 + classes = [ 'controls' ]
92 92 classes << ('input-' + options.delete(:add_on).to_s) if options[:add_on]
93 93
94 94 self.div_wrapper(attribute) do
@@ -106,7 +106,7 @@ def inline(label = nil, &block)
106 106 define_method toggle do |attribute, *args, &block|
107 107 label = args.first.nil? ? '' : args.shift
108 108 target = self.object_name.to_s + '_' + attribute.to_s
109   - label_attrs = toggle == :check_box ? { :for => target } : {}
  109 + label_attrs = toggle == :check_box ? { :for => target, :class => 'checkbox' } : { :class => 'radio' }
110 110
111 111 template.content_tag(:li) do
112 112 template.concat template.content_tag(:label, label_attrs) {
@@ -132,7 +132,7 @@ def inline(label = nil, &block)
132 132 #
133 133 def div_wrapper(attribute, options = {}, &block)
134 134 options[:id] = _wrapper_id attribute, options[:id]
135   - options[:class] = _wrapper_classes attribute, options[:class], 'clearfix'
  135 + options[:class] = _wrapper_classes attribute, options[:class], 'control-group'
136 136
137 137 template.content_tag :div, options, &block
138 138 end
@@ -164,7 +164,7 @@ def _wrapper_id(attribute, default = nil)
164 164 default || [
165 165 _object_name + _object_index,
166 166 _attribute_name(attribute),
167   - 'input'
  167 + 'controls'
168 168 ].join('_')
169 169 end
170 170
2  lib/twitter_bootstrap_form_for/version.rb
... ... @@ -1,3 +1,3 @@
1 1 module TwitterBootstrapFormFor
2   - VERSION = '1.0.5'
  2 + VERSION = '1.0.8'
3 3 end

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.