RailsEventStore/cqrs-es-sample-with-res

View on GitHub
rails_application/app/views/kaminari/_page.html.erb

Summary

Maintainability
Test Coverage
<%# Link showing page number
  - available local variables
    page:          a page object for "this" page
    url:           url to this page
    current_page:  a page object for the currently displayed page
    total_pages:   total number of pages
    per_page:      number of items to fetch per page
    remote:        data-remote
-%>

<%= link_to page, url, {
  remote: remote,
  rel: page.rel,
  class: class_names(
    "relative inline-flex items-center px-4 py-2 border text-sm font-medium",
    "z-10 bg-blue-50 border-blue-500 text-blue-600 " => page.current?,
    "bg-white border-gray-300 text-gray-500 hover:bg-gray-50" => !page.current?
  )
}.merge(Hash(({"aria-current": "page"} if page.current?))) %>