add html safe option

This commit is contained in:
John Bintz 2012-12-12 20:25:05 -05:00
parent 5bf8939a43
commit 3ffc64cc48
1 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,10 @@ module SemanticRailsViewHelpers
value = raw_value
value = value.to_label if value.respond_to?(:to_label)
if options[:raw]
value = value.html_safe
end
if SemanticRailsViewHelpers.semantic_data?
value = @context.content_tag(:data, value, 'data-field' => field)
end
@ -41,6 +45,10 @@ module SemanticRailsViewHelpers
(value or '').html_safe
end
def field!(field, options = {}, &block)
self.field(field, options.merge(:raw => true), &block)
end
class TagBuilder
def initialize(attributes_builder)
@attributes_builder = attributes_builder