Skip to content

Commit

Permalink
Make label content HTML safe.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreisner committed May 4, 2010
1 parent b7209fc commit 701b59a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/informant.rb
Expand Up @@ -202,9 +202,10 @@ def label(method, text = nil, options = {})
options.delete :label_for
options.delete :required

text = text.blank?? method.to_s.humanize : text.to_s
text += ':' if colon
text += ' <span class="required">*</span>' if required
text = text.blank?? method.to_s.humanize : h(text.to_s)
text << ':' if colon
text << @template.content_tag(:span, "*", :class => "required") if required
text = text.html_safe
super
end

Expand Down

0 comments on commit 701b59a

Please sign in to comment.