Class: Rango::Pagination::Strategies::PageNumberOnTheEndOfRouteExcludeFirstPage
- Inherits:
-
Rango::Pagination::Strategy
- Object
- Rango::Pagination::Strategy
- Rango::Pagination::Strategies::PageNumberOnTheEndOfRouteExcludeFirstPage
- Defined in:
- lib/rango/contrib/pagination/strategies.rb
Instance Method Summary collapse
-
#hook(request, from, page) ⇒ Object
Here is terrible important the from parameter.
Methods inherited from Rango::Pagination::Strategy
Instance Method Details
#hook(request, from, page) ⇒ Object
Here is terrible important the from parameter
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/rango/contrib/pagination/strategies.rb', line 35 def hook(request, from, page) if from.number.eql?(1) # /products File.join(request.url, page.to_s) elsif page.eql?(1) && ! from.number.eql?(1) File.join((request.url)[0..-2]).chomp("/") else # /products/2 return PageNumberOnTheEndOfRoute.new.hook(request, from, page) end end |