-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kaminari pagination default view #42
Conversation
Gemfile
Outdated
@@ -6,6 +6,8 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |||
# Specify your gem's dependencies in tramway.gemspec. | |||
gemspec | |||
|
|||
gem 'anyway_config' | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why you need empty lines in gemfile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need, you are right! Removed 🙂
lib/tramway/engine.rb
Outdated
# :reek:NestedIterators { enabled: false } | ||
# :reek:TooManyStatements { enabled: false } | ||
def configure_pagination | ||
ActiveSupport.on_load(:action_controller) do |_| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ActiveSupport.on_load(:action_controller) do |_| | |
ActiveSupport.on_load(:action_controller) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
%nav.pagination.flex.items-center.justify-center.space-x-1 | ||
= first_page_tag unless current_page.first? | ||
= prev_page_tag unless current_page.first? | ||
- each_page do |page| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe its better empty line before and after each
. just to make the code easier to read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no such empty lines in default kaminari views, so I think we don't need them either 🙂
What's changed basically?
This update is not supposed to set the default pagination behavior of applications, just setting views for kaminari.
Engine
classAbout dummy application views.
I have a plan to use these views as Tramway default views. That's dummy application views are already Tailwind-styled.
What's changed for tramway drivers?
To use tailwind-styled pagination
Gemfile
config/initializers/tramway.rb
app/views/users/index.html.haml
= paginate @users # it will render tailwind-styled pagination buttons by default
Pagination buttons look like this
Song for code review
It's Pentatonix this time. I know that one track is enough for the code review, so I'll prepare a little playlist next time 🙂
https://youtu.be/ywYfMlyIkeo?si=jo7rUFGw6aZzB-Kh