Class: Redmine::Views::OtherFormatsBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine/views/other_formats_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(view) ⇒ OtherFormatsBuilder


18
19
20
# File 'lib/redmine/views/other_formats_builder.rb', line 18

def initialize(view)
  @view = view
end

Instance Method Details


22
23
24
25
26
27
# File 'lib/redmine/views/other_formats_builder.rb', line 22

def link_to(name, options={})
  url = { :format => name.to_s.downcase }.merge(options.delete(:url) || {})
  caption = options.delete(:caption) || name
  html_options = { :class => name.to_s.downcase, :rel => 'nofollow' }.merge(options)
  @view.('span', @view.link_to(caption, url, html_options))
end