class HtmlSlicer::Helpers::Tag
This part of code is almost completely ported from Kaminari
gem by Akira Matsuda. Look at github.com/amatsuda/kaminari/tree/master/lib/kaminari/helpers
¶ ↑
A tag stands for an HTML tag inside the paginator. Basically, a tag has its own partial template file, so every tag can be rendered into String using its partial template.
The template file should be placed in your app/views/html_slicer/ directory with underscored class name (besides the “Tag” class. Tag
is an abstract class, so _tag parital is not needed).
e.g.) PrevLink -> app/views/html_slicer/_prev_link.html.erb
When no matching template were found in your app, the engine's pre installed template will be used.
e.g.) Paginator -> $GEM_HOME/html_slicer-x.x.x/app/views/html_slicer/_paginator.html.erb
Public Instance Methods
slice_url_for(slice)
click to toggle source
# File lib/html_slicer/helpers/tags.rb, line 33 def slice_url_for(slice) # +@params.merge_hashup+: returns deep merged params with a new slice number value. @template.url_for @params.merge_hashup(*@param_name, (slice <= 1 ? nil : slice)) end