Skip to content
This repository has been archived by the owner on Aug 4, 2018. It is now read-only.

Added :control_group option #60

Merged
merged 1 commit into from
Nov 21, 2012
Merged

Conversation

mwanji
Copy link
Contributor

@mwanji mwanji commented Nov 21, 2012

This option removes most of the form row HTML, such as the control-group, control-label and controls blocks.

I've found this handy for things like putting more than one form field on a single line, or generally getting fine-grained layout control without losing bootstrap_forms's benefits and nice API.

@sethvargo
Copy link
Owner

@mwanji the build is failing, can you take a look at why that's happening?

@mwanji
Copy link
Contributor Author

mwanji commented Nov 21, 2012

According to this stacktrace:

/sethvargo/bootstrap_forms/spec/spec_helper.rb:4 requires 'capybara/rspec'

This ultimately leads to a missing Nokogiri:
/activesupport-3.2.9/lib/active_support/dependencies.rb:251:inrequire': no such file to load -- nokogiri (LoadError)`

Do you have an idea what could be causing this?

@sethvargo
Copy link
Owner

Do your tests pass locally? Try bundle update and update the Gemfile
On Nov 21, 2012, at 10:16 AM, Moandji Ezana notifications@github.com wrote:

/sethvargo/bootstrap_forms/spec/spec_helper.rb:4 requires 'capybara/rspec'

This ultimately leads to a missing Nokogiri:
/activesupport-3.2.9/lib/active_support/dependencies.rb:251:inrequire': no such file to load -- nokogiri (LoadError)`

Do you have an idea what could be causing this?


Reply to this email directly or view it on GitHub.

@mwanji
Copy link
Contributor Author

mwanji commented Nov 21, 2012

I get the same error after a bundle update. Looking at Gemfile.lock, capybara has no dependencies, even though it should have several, including nokogiri.

This issue might be related: teamcapybara/capybara#880

@sethvargo
Copy link
Owner

@mwanji can you make sure your editor trims whitespace at the end of lines? I'm seeing this in the diff:

-        klasses = ['control-group']
+        klasses = []
+        klasses << 'control-group' unless @field_options[:control_group] == false
         klasses << 'error' if @field_options[:error]
         klasses << 'success' if @field_options[:success]
         klasses << 'warning' if @field_options[:warning]
+        
+        control_group_options = {}
+        control_group_options[:class] = klasses if !klasses.empty?

-        content_tag(:div, :class => klasses, &block)
+        content_tag(:div, control_group_options, &block)
       end

Specifically notice the blank green line? That just causes headaches down the line.

@sethvargo sethvargo merged commit fcdd313 into sethvargo:master Nov 21, 2012
@sethvargo
Copy link
Owner

I've merged this, because it seems to be an issue with travis actually.

@mwanji
Copy link
Contributor Author

mwanji commented Nov 22, 2012

Thanks for merging. I think I can now get my project off my fork :).

can you make sure your editor trims whitespace at the end of lines?

I'll look into it.

Also, this really seem to be an issue with capybara or even in capybara's dependencies, as many other people have had this issue: teamcapybara/capybara#882

@jsmestad
Copy link
Contributor

Is it possible to remove the div all together? -- This is having issues with the following bootstrap selector when using .controls-row

.controls-row [class*="span"] + [class*="span"] {
  margin-left: 30px;
}

@sethvargo
Copy link
Owner

@jsmestad has the suggested markup for a form changed recently? Last time I looked, it recommended the markup being generated.

@jsmestad
Copy link
Contributor

Taking a look at Control Sizing inside of the latest Twitter docs: http://twitter.github.com/bootstrap/base-css.html#forms

@sethvargo
Copy link
Owner

@jsmestad Can you open a new issue with the code you're using, the generated markup, and the expected markup? I don't want to pollute this issue.

@sethvargo
Copy link
Owner

See #62 for the new issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants