Class: PollTags::RadiantLinkRenderer
- Inherits:
-
WillPaginate::LinkRenderer
- Object
- WillPaginate::LinkRenderer
- PollTags::RadiantLinkRenderer
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/poll_tags.rb
Instance Method Summary collapse
- #gap_marker ⇒ Object
-
#initialize(tag) ⇒ RadiantLinkRenderer
constructor
A new instance of RadiantLinkRenderer.
- #page_link(page, text, attributes = {}) ⇒ Object
- #page_span(page, text, attributes = {}) ⇒ Object
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_marker ⇒ Object
19 20 21 |
# File 'lib/poll_tags.rb', line 19 def gap_marker '<span class="gap">…</span>' end |
#page_link(page, text, attributes = {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/poll_tags.rb', line 13 def page_link(page, text, attributes = {}) attributes = (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 = (attributes) "<span#{attributes}>#{text}</span>" end |