Class: PollTags::RadiantLinkRenderer

Inherits:
WillPaginate::LinkRenderer
  • Object
show all
Includes:
ActionView::Helpers::TagHelper
Defined in:
lib/poll_tags.rb

Instance Method Summary collapse

Constructor Details

#initialize(tag) ⇒ RadiantLinkRenderer

Returns a new instance of RadiantLinkRenderer.



9
10
11
# File 'lib/poll_tags.rb', line 9

def initialize(tag)
  @tag = tag
end

Instance Method Details

#gap_markerObject



19
20
21
# File 'lib/poll_tags.rb', line 19

def gap_marker
  '<span class="gap">&#8230;</span>'
end


13
14
15
16
17
# File 'lib/poll_tags.rb', line 13

def page_link(page, text, attributes = {})
  attributes = tag_options(attributes)
  @paginate_url_route = @paginate_url_route.blank? ? PollsExtension::UrlCache : @paginate_url_route
  %Q{<a href="#{@tag.locals.page.url}#{@paginate_url_route}#{page}"#{attributes}>#{text}</a>}
end

#page_span(page, text, attributes = {}) ⇒ Object



23
24
25
26
# File 'lib/poll_tags.rb', line 23

def page_span(page, text, attributes = {})
  attributes = tag_options(attributes)
  "<span#{attributes}>#{text}</span>"
end