Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleanup Labelling#label_html_options

  • Loading branch information...
commit d318815e6ed5907868e437c943ac3c0c2e38ce82 1 parent 182b954
@jpmckinney jpmckinney authored
Showing with 4 additions and 7 deletions.
  1. +4 −7 lib/formtastic/inputs/base/labelling.rb
View
11 lib/formtastic/inputs/base/labelling.rb
@@ -10,13 +10,10 @@ def label_html
end
def label_html_options
- # opts = options_for_label(options) # TODO
- opts = {}
- opts[:for] ||= input_html_options[:id]
- opts[:class] = [opts[:class]]
- opts[:class] << 'label'
-
- opts
+ {
+ :for => input_html_options[:id],
+ :class => ['label'],
@RajRoR
RajRoR added a note

@jpmckinney How I can avoid having 'label' as class for my all labels in semantic_form_for?

I am using bootstrap, so bootstrap defines 'label' class as:

.label {
  display: inline;
  padding: .25em .6em;
  font-size: 75%;
  font-weight: bold;
  line-height: 1;
  color: #ffffff;
  text-align: center;
  white-space: nowrap; 
  vertical-align: baseline;
  border-radius: .25em;
}

Now, as you can see, its making labels text WHITE. This is my problem. I just want to avoid having label class.

@RajRoR You should open an issue on Formtastic. I'm not the maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ }
end
def label_text
Please sign in to comment.
Something went wrong with that request. Please try again.