12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/link_block/view_helpers.rb', line 12
def link_to(*args, &block)
if block_given?
url_options = get_url_options(args.first)
html_options = args.second.merge(@html_options)
link_to(capture(&block), url_options, html_options)
else
link_text = args.first
url_options = get_url_options(args.second)
html_options = (args.third || {}).merge(@html_options)
end
if LinkBlock::Config.current_class_enabled and @controller.current_page?(url_options)
html_options[:class] ||= ""
html_options[:class] += " #{LinkBlock::Config.current_class_name}"
end
@controller.link_to(link_text, url_options, html_options)
end
|