app/helpers/coco/url_helper.rb in coveragebook_components-0.7.9 vs app/helpers/coco/url_helper.rb in coveragebook_components-0.7.10
- old
+ new
@@ -7,10 +7,14 @@
options ||= {}
html_options = Coco::ActionViewHelper.convert_options_to_data_attributes(options, html_options)
href = Coco::ActionViewHelper.url_target(name, options)
- coco_link(name, href, **html_options.symbolize_keys!, &block)
+ if block
+ coco_link(href, **html_options.symbolize_keys!, &block)
+ else
+ coco_link(name, href, **html_options.symbolize_keys!)
+ end
end
def coco_button_to(name = nil, options = nil, html_options = nil, &block)
html_options, options = options, name if block
options ||= {}