some fixes
This commit is contained in:
parent
8a82530f96
commit
40b24799af
|
@ -16,11 +16,15 @@ module SemanticRailsViewHelpers
|
|||
@context.capture(self, &@block)
|
||||
end
|
||||
|
||||
def field(field, options = {})
|
||||
def field(field, options = {}, &block)
|
||||
if options[:value]
|
||||
raw_value = options[:value]
|
||||
else
|
||||
raw_value = @object.send(field)
|
||||
|
||||
if block
|
||||
raw_value = block.call(raw_value)
|
||||
end
|
||||
end
|
||||
|
||||
value = raw_value
|
||||
|
|
|
@ -41,8 +41,8 @@ module SemanticRailsViewHelpers
|
|||
link_to label, polymorphic_url(route, :action => action), options.merge("data-action" => target_action)
|
||||
end
|
||||
|
||||
def li_for(object, &block)
|
||||
content_tag(:li, capture(&block), 'data-id' => object.id)
|
||||
def li_for(object, options = {}, &block)
|
||||
content_tag(:li, capture(&block), options.merge('data-id' => object.id))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue