link_helper.rb revision c5f48727b8f703a9f3abe1d2215ed3aad69f5d76
'data-type' => resource.class,
end
text << content_tag(:span, counter==1 ? subject : subject.pluralize)
link_to text, url
end
def format_links(*args, &block)
options = args.extract_options!
args = %w(xml json) if args.empty?
args.flatten!
options[:url] ||= {}
links = ''
links << capture(&block) << ' ' if block_given?
links << args.collect{ |f|
content_tag :li, link_to(f.to_s.upcase, params.merge(options[:url]).merge(:format => f), :title => "Get this page as #{f.upcase}")
}.join("")
content_tag('ul', links.html_safe, :class => 'formats')
end
end