-
Notifications
You must be signed in to change notification settings - Fork 13
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
Sweep: Pagination Missing on "Shop Summary" Merchant Table (β Sandbox Passed) #100
Sweep: Pagination Missing on "Shop Summary" Merchant Table (β Sandbox Passed) #100
Conversation
Rollback Files For Sweep
This is an automated message generated by Sweep AI. |
|
||
def link_to_previous_page(collection, options) | ||
unless collection.first_page? | ||
link_to 'Previous', url_for(page: collection.prev_page), class: options[:previous_class] || "prev-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.
[standard] <Style/StringLiterals> reported by reviewdog πΆ
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
link_to 'Previous', url_for(page: collection.prev_page), class: options[:previous_class] || "prev-page" | |
link_to "Previous", url_for(page: collection.prev_page), class: options[:previous_class] || "prev-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.
|
||
def link_to_next_page(collection, options) | ||
unless collection.last_page? | ||
link_to 'Next', url_for(page: collection.next_page), class: options[:next_class] || "next-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.
[standard] <Style/StringLiterals> reported by reviewdog πΆ
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
link_to 'Next', url_for(page: collection.next_page), class: options[:next_class] || "next-page" | |
link_to "Next", url_for(page: collection.next_page), class: options[:next_class] || "next-page" |
app/helpers/pagination_helper.rb
Outdated
end_page = [collection.current_page + options[:page_range], collection.total_pages].min | ||
|
||
(start_page..end_page).map do |page| | ||
link_to page, url_for(page: page), class: (page == collection.current_page ? options[:active_class] : options[:page_class]) |
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.
[standard] <Style/TernaryParentheses> reported by reviewdog πΆ
Use parentheses for ternary expressions with complex conditions.
link_to page, url_for(page: page), class: (page == collection.current_page ? options[:active_class] : options[:page_class]) | |
link_to page, url_for(page: page), class: ((page == collection.current_page ? options[:active_class] : options[:page_class]) |
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.
config/routes.rb
Outdated
@@ -18,7 +18,7 @@ | |||
resources :summarys, only: [] do | |||
collection do | |||
get :monthly, to: "summarys/monthly#index" | |||
get :shop, to: "summarys/shop#index" | |||
get 'shops/index/(:page)', to: 'shops#index', as: 'shops_index' |
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.
[standard] <Style/StringLiterals> reported by reviewdog πΆ
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
get 'shops/index/(:page)', to: 'shops#index', as: 'shops_index' | |
get "shops/index/(:page)", to: 'shops#index', as: 'shops_index' |
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.
config/routes.rb
Outdated
@@ -18,7 +18,7 @@ | |||
resources :summarys, only: [] do | |||
collection do | |||
get :monthly, to: "summarys/monthly#index" | |||
get :shop, to: "summarys/shop#index" | |||
get 'shops/index/(:page)', to: 'shops#index', as: 'shops_index' |
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.
[standard] <Style/StringLiterals> reported by reviewdog πΆ
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
get 'shops/index/(:page)', to: 'shops#index', as: 'shops_index' | |
get 'shops/index/(:page)', to: "shops#index", as: 'shops_index' |
config/routes.rb
Outdated
@@ -18,7 +18,7 @@ | |||
resources :summarys, only: [] do | |||
collection do | |||
get :monthly, to: "summarys/monthly#index" | |||
get :shop, to: "summarys/shop#index" | |||
get 'shops/index/(:page)', to: 'shops#index', as: 'shops_index' |
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.
[standard] <Style/StringLiterals> reported by reviewdog πΆ
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
get 'shops/index/(:page)', to: 'shops#index', as: 'shops_index' | |
get 'shops/index/(:page)', to: 'shops#index', as: "shops_index" |
config/routes.rb
Outdated
@@ -18,7 +18,7 @@ | |||
resources :summarys, only: [] do | |||
collection do | |||
get :monthly, to: "summarys/monthly#index" | |||
get :shop, to: "summarys/shop#index" | |||
get 'shops/index/(:page)', to: 'shops#index', as: 'shops_index' |
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.
[standard] <Style/StringLiterals> reported by reviewdog πΆ
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
get 'shops/index/(:page)', to: 'shops#index', as: 'shops_index' | |
get "shops/index/(:page)", to: 'shops#index', as: 'shops_index' |
config/routes.rb
Outdated
@@ -18,7 +18,7 @@ | |||
resources :summarys, only: [] do | |||
collection do | |||
get :monthly, to: "summarys/monthly#index" | |||
get :shop, to: "summarys/shop#index" | |||
get 'shops/index/(:page)', to: 'shops#index', as: 'shops_index' |
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.
[standard] <Style/StringLiterals> reported by reviewdog πΆ
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
get 'shops/index/(:page)', to: 'shops#index', as: 'shops_index' | |
get "shops/index/(:page)", to: "shops#index", as: 'shops_index' |
config/routes.rb
Outdated
@@ -18,7 +18,7 @@ | |||
resources :summarys, only: [] do | |||
collection do | |||
get :monthly, to: "summarys/monthly#index" | |||
get :shop, to: "summarys/shop#index" | |||
get 'shops/index/(:page)', to: 'shops#index', as: 'shops_index' |
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.
[standard] <Style/StringLiterals> reported by reviewdog πΆ
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
get 'shops/index/(:page)', to: 'shops#index', as: 'shops_index' | |
get "shops/index/(:page)", to: 'shops#index', as: "shops_index" |
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.
app/helpers/pagination_helper.rb
Outdated
end_page = [collection.current_page + options[:page_range], collection.total_pages].min | ||
|
||
(start_page..end_page).map do |page| | ||
link_to page, url_for(page: page), class: (page == collection.current_page ? options[:active_class] : options[:page_class]) |
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.
[standard] <Style/TernaryParentheses> reported by reviewdog πΆ
Use parentheses for ternary expressions with complex conditions.
link_to page, url_for(page: page), class: (page == collection.current_page ? options[:active_class] : options[:page_class]) | |
link_to page, url_for(page: page), class: (((page == collection.current_page ? options[:active_class] : options[:page_class])) |
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.
config/routes.rb
Outdated
@@ -18,7 +18,7 @@ | |||
resources :summarys, only: [] do | |||
collection do | |||
get :monthly, to: "summarys/monthly#index" | |||
get :shop, to: "summarys/shop#index" | |||
get "shops/index/(:page)", to: 'shops#index', as: 'shops_index' |
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.
[standard] <Style/StringLiterals> reported by reviewdog πΆ
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
get "shops/index/(:page)", to: 'shops#index', as: 'shops_index' | |
get "shops/index/(:page)", to: "shops#index", as: 'shops_index' |
config/routes.rb
Outdated
@@ -18,7 +18,7 @@ | |||
resources :summarys, only: [] do | |||
collection do | |||
get :monthly, to: "summarys/monthly#index" | |||
get :shop, to: "summarys/shop#index" | |||
get "shops/index/(:page)", to: 'shops#index', as: 'shops_index' |
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.
[standard] <Style/StringLiterals> reported by reviewdog πΆ
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
get "shops/index/(:page)", to: 'shops#index', as: 'shops_index' | |
get "shops/index/(:page)", to: 'shops#index', as: "shops_index" |
app/helpers/pagination_helper.rb
Outdated
end_page = [collection.current_page + options[:page_range], collection.total_pages].min | ||
|
||
(start_page..end_page).map do |page| | ||
link_to page, url_for(page: page), class: ((page == collection.current_page ? options[:active_class] : options[:page_class])) |
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.
[standard] <Style/TernaryParentheses> reported by reviewdog πΆ
Use parentheses for ternary expressions with complex conditions.
link_to page, url_for(page: page), class: ((page == collection.current_page ? options[:active_class] : options[:page_class])) | |
link_to page, url_for(page: page), class: (((page == collection.current_page ? options[:active_class] : options[:page_class])) |
app/helpers/pagination_helper.rb
Outdated
end_page = [collection.current_page + options[:page_range], collection.total_pages].min | ||
|
||
(start_page..end_page).map do |page| | ||
link_to page, url_for(page: page), class: ((page == collection.current_page ? options[:active_class] : options[:page_class])) |
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.
[standard] <Style/TernaryParentheses> reported by reviewdog πΆ
Use parentheses for ternary expressions with complex conditions.
link_to page, url_for(page: page), class: ((page == collection.current_page ? options[:active_class] : options[:page_class])) | |
link_to page, url_for(page: page), class: ((((page == collection.current_page ? options[:active_class] : options[:page_class]))) |
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.
@@ -18,7 +18,7 @@ | |||
resources :summarys, only: [] do | |||
collection do | |||
get :monthly, to: "summarys/monthly#index" | |||
get :shop, to: "summarys/shop#index" | |||
get "shops/index/(:page)", to: 'shops#index', as: "shops_index" |
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.
[standard] <Style/StringLiterals> reported by reviewdog πΆ
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
get "shops/index/(:page)", to: 'shops#index', as: "shops_index" | |
get "shops/index/(:page)", to: "shops#index", as: "shops_index" |
app/helpers/pagination_helper.rb
Outdated
end_page = [collection.current_page + options[:page_range], collection.total_pages].min | ||
|
||
(start_page..end_page).map do |page| | ||
link_to page, url_for(page: page), class: (((page == collection.current_page ? options[:active_class] : options[:page_class]))) |
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.
[standard] <Style/TernaryParentheses> reported by reviewdog πΆ
Use parentheses for ternary expressions with complex conditions.
link_to page, url_for(page: page), class: (((page == collection.current_page ? options[:active_class] : options[:page_class]))) | |
link_to page, url_for(page: page), class: ((((page == collection.current_page ? options[:active_class] : options[:page_class]))) |
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.
end_page = [collection.current_page + options[:page_range], collection.total_pages].min | ||
|
||
(start_page..end_page).map do |page| | ||
link_to page, url_for(page: page), class: ((((page == collection.current_page ? options[:active_class] : options[:page_class])))) |
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.
[standard] <Style/TernaryParentheses> reported by reviewdog πΆ
Use parentheses for ternary expressions with complex conditions.
link_to page, url_for(page: page), class: ((((page == collection.current_page ? options[:active_class] : options[:page_class])))) | |
link_to page, url_for(page: page), class: (((((page == collection.current_page ? options[:active_class] : options[:page_class])))) |
PR Feedback: π
Description
This pull request adds pagination functionality to the "Shop Summary" merchant table. It includes changes to the
ShopsController
,PaginationHelper
,index.html.erb
, androutes.rb
files.Summary
index
action toShopsController
to fetch paginated shopsPaginationHelper
module with methods for custom pagination renderingindex.html.erb
to include pagination for@shops
routes.rb
to add a route forshops#index
with pagination parameterFixes #96.
π Latest improvements to Sweep:
π‘ To get Sweep to edit this pull request, you can: