Class: Uchi::Ui::Pagination::PreviousLink

Inherits:
Item
  • Object
show all
Defined in:
app/components/uchi/ui/pagination/previous_link.rb

Instance Attribute Summary

Attributes inherited from Item

#page_number, #paginator

Instance Method Summary collapse

Methods inherited from Item

#initialize, #page_url

Constructor Details

This class inherits a constructor from Uchi::Ui::Pagination::Item

Instance Method Details

#previous?Boolean

Returns true if there is a previous page

Returns:

  • (Boolean)


8
9
10
# File 'app/components/uchi/ui/pagination/previous_link.rb', line 8

def previous?
  paginator.page > 1
end

#urlObject



12
13
14
15
16
17
18
# File 'app/components/uchi/ui/pagination/previous_link.rb', line 12

def url
  if previous?
    page_url(:previous)
  else
    page_url(:first)
  end
end