Class: RedmineExtensions::Export::EasyOtherFormatsBuilder
- Defined in:
- lib/redmine_extensions/export/easy_other_formats_builder.rb
Instance Method Summary collapse
-
#initialize(view) ⇒ EasyOtherFormatsBuilder
constructor
A new instance of EasyOtherFormatsBuilder.
-
#link_to(name, *args) ⇒ Object
name
,query
,options
.
Constructor Details
#initialize(view) ⇒ EasyOtherFormatsBuilder
Returns a new instance of EasyOtherFormatsBuilder.
4 5 6 |
# File 'lib/redmine_extensions/export/easy_other_formats_builder.rb', line 4 def initialize(view) @view = view end |
Instance Method Details
#link_to(name, *args) ⇒ Object
name
, query
, options
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/redmine_extensions/export/easy_other_formats_builder.rb', line 13 def link_to(name, *args) = args. format = name.to_s.downcase query = args.shift url = .delete(:url) || {} url.stringify_keys! params = @view.params.except('page', 'controller', 'action').merge(:format => format) if query && url.blank? url = query.path(params) else url = params.merge(url) end = .delete(:caption) || name = { :class => format, :rel => 'nofollow' }.merge() @view.content_tag('span', @view.link_to(, url, )) end |