Add turbo to Issues page

This commit is contained in:
nertc 2024-08-27 11:50:43 +04:00
parent c32f6dd4ff
commit 3cf5667c91
3 changed files with 37 additions and 34 deletions

View file

@ -45,6 +45,7 @@ class IssuesController < ApplicationController
end
@issues, @newer_issues_id, @older_issues_id = get_page_items(@issues, :limit => @params[:limit])
render :partial => "page" if turbo_frame_request_id == "pagination"
end
def show

View file

@ -1,3 +1,4 @@
<turbo-frame id="pagination" target="_top">
<table class="table table-sm">
<thead>
<tr>
@ -32,3 +33,4 @@
:older_key => "issues.page.older_issues",
:newer_id => @newer_issues_id,
:older_id => @older_issues_id %>
</turbo-frame>

View file

@ -181,12 +181,12 @@ class IssuesTest < ApplicationSystemTestCase
click_on I18n.t("issues.page.older_issues")
assert_no_content I18n.t("issues.index.user_not_found")
assert_no_content I18n.t("issues.index.issues_not_found")
assert_css "tr", :count => 31, :wait => 1
assert_css "tr", :count => 31
# Back to First Page
click_on I18n.t("issues.page.newer_issues")
assert_no_content I18n.t("issues.index.user_not_found")
assert_no_content I18n.t("issues.index.issues_not_found")
assert_css "tr", :count => 51, :wait => 1
assert_css "tr", :count => 51
end
end