label => false on timish not html_safe > fixed #641

Merged
merged 2 commits into from Jul 31, 2011

Conversation

Projects
None yet
3 participants
Contributor

nathanscott commented Jul 31, 2011

= input.input :start_time, :label => false

would render non html_safe string

Used technique used on stringish labels

# labelling.rb:8
def label_html
  render_label? ? builder.label(input_name, label_text, label_html_options) : "".html_safe
end
Collaborator

sobrinho commented Jul 31, 2011

Could you add a test case too?

Contributor

nathanscott commented Jul 31, 2011

Sure.

Contributor

nathanscott commented Jul 31, 2011

I'm guessing eventually there'll be a feature request for each of the fragment labels to be removable. Passing label => false only removes the label off the full fragment set.

For now, that's a feature not a bug - right?

sobrinho added a commit that referenced this pull request Jul 31, 2011

Merge pull request #641 from nathanscott/master
label => false on timish not html_safe > fixed

@sobrinho sobrinho merged commit 4202457 into justinfrench:master Jul 31, 2011

Collaborator

sobrinho commented Jul 31, 2011

Pulled, thanks!

What you mean with 'each fragment'?

Currently fields are displayed like this:

Published at      [year] [month] [day]

Passing false to label option you will get something like this:

                  [year] [month] [day]

Maybe I misunderstood the question.

Owner

justinfrench commented Jul 31, 2011

@sobrinho the year, month and day (fragments) have their own labels, which formtastic.css hides.

@nathanscott correct, feature request, not a bug. Thanks for this patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment