Skip to content

Commit

Permalink
Issue #81. Add pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashnikovisme committed Nov 19, 2024
1 parent abd0ccd commit 4b6305e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/views/tramway/entities/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
%h1.font-bold.text-4xl.dark:text-white
= page_title

- if Tramway.config.pagination[:enabled]
= paginate @entities

- if decorator_class(@entities).list_attributes.empty?
%p.text-center.mt-10
You should fill `list_attributes` inside your
Expand All @@ -14,3 +17,6 @@
= component 'tailwinds/table/header', headers: decorator_class(@entities).list_attributes.map { |attribute| @model_class.human_attribute_name(attribute) }
- @entities.each do |item|
= render 'entity', entity: item

= paginate @entities

1 change: 1 addition & 0 deletions tramway.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md']
end

spec.add_dependency 'anyway_config'
spec.add_dependency 'dry-struct'
spec.add_dependency 'haml-rails'
spec.add_dependency 'rails', '~> 7'
Expand Down

0 comments on commit 4b6305e

Please sign in to comment.