link_helper.rb revision 1ce62f5bb9fe0d729f767af704035b9536e7d7fc
78fa3c578c14ee8a612f86cf73b6181c7f16463fTimo Sirainen collection.includes(:entity_mappings).each do |link|
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen hash[sym] << {link: link, target: mapping.target}
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen hash[sym] = [{link: link, target: mapping.target}]
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen clazz = 'Ontology' if clazz.to_s.include?('Ontology')
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen :title => resource.respond_to?(:title) ? resource.title : nil
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen :title => resource.last.respond_to?(:title) ? resource.last.title : nil
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen text << content_tag(:span, counter==1 ? subject : subject.pluralize)
78fa3c578c14ee8a612f86cf73b6181c7f16463fTimo Sirainen link_to text, url
6c2ce1d5bf17b21e804a079eb0f973b7ab83e0d8Timo Sirainen def format_links(*args, &block)
78fa3c578c14ee8a612f86cf73b6181c7f16463fTimo Sirainen options = args.extract_options!
78fa3c578c14ee8a612f86cf73b6181c7f16463fTimo Sirainen args = %w(xml json) if args.empty?
78fa3c578c14ee8a612f86cf73b6181c7f16463fTimo Sirainen args.flatten!
6c2ce1d5bf17b21e804a079eb0f973b7ab83e0d8Timo Sirainen options[:url] ||= {}
6c2ce1d5bf17b21e804a079eb0f973b7ab83e0d8Timo Sirainen links << capture(&block) << ' ' if block_given?
6c2ce1d5bf17b21e804a079eb0f973b7ab83e0d8Timo Sirainen links << args.collect{ |f|
6c2ce1d5bf17b21e804a079eb0f973b7ab83e0d8Timo Sirainen content_tag :li, link_to(f.to_s.upcase, params.merge(options[:url]).merge(:format => f), :title => "Get this page as #{f.upcase}")
6c2ce1d5bf17b21e804a079eb0f973b7ab83e0d8Timo Sirainen content_tag('ul', links.html_safe, :class => 'formats')