Remove kaminari_path
The main reason to use it was the `rel` attribute for previous/next pages not being indexed correctly by certain search engines when using a relative URL. However, AFAIK that only applied to `<link>` tags, not to `<a>` tags, and only if a `<base>` tag was defined. In any case, it looks like the same search engines don't use the `rel` attribute for previous/next to index pages anymore.
This commit is contained in:
@@ -55,10 +55,6 @@ module ApplicationHelper
|
||||
SiteCustomization::ContentBlock.block_for(name, locale)
|
||||
end
|
||||
|
||||
def kaminari_path(url)
|
||||
"#{root_url.chomp("\/")}#{url}"
|
||||
end
|
||||
|
||||
def self.asset_data_base64(path)
|
||||
asset = (Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application))
|
||||
.find_asset(path)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<li>
|
||||
<%= link_to t("views.pagination.first"), kaminari_path(url), :remote => remote %>
|
||||
<%= link_to t("views.pagination.first"), url, :remote => remote %>
|
||||
</li>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<li>
|
||||
<%= link_to t("views.pagination.last"), kaminari_path(url), :remote => remote %>
|
||||
<%= link_to t("views.pagination.last"), url, :remote => remote %>
|
||||
</li>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<li class="pagination-next">
|
||||
<%= link_to t("views.pagination.next"), kaminari_path(url), :rel => "next", :remote => remote %>
|
||||
<%= link_to t("views.pagination.next"), url, :rel => "next", :remote => remote %>
|
||||
</li>
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
</li>
|
||||
<% else %>
|
||||
<li>
|
||||
<%= link_to page, kaminari_path(url), { :remote => remote, :rel => page.next? ? "next" : page.prev? ? "prev" : nil } %>
|
||||
<%= link_to page, url, { :remote => remote, :rel => page.next? ? "next" : page.prev? ? "prev" : nil } %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<li class="pagination-previous">
|
||||
<%= link_to t("views.pagination.previous"), kaminari_path(url), :rel => "prev", :remote => remote %>
|
||||
<%= link_to t("views.pagination.previous"), url, :rel => "prev", :remote => remote %>
|
||||
</li>
|
||||
|
||||
@@ -47,7 +47,7 @@ describe "Documents" do
|
||||
|
||||
within("ul.pagination") do
|
||||
expect(page).to have_content("1")
|
||||
expect(page).to have_link("2", href: admin_site_customization_documents_url(page: 2))
|
||||
expect(page).to have_link("2", href: admin_site_customization_documents_path(page: 2))
|
||||
expect(page).not_to have_content("3")
|
||||
click_link "Next", exact: false
|
||||
end
|
||||
|
||||
@@ -103,7 +103,7 @@ describe "Proposals" do
|
||||
|
||||
within("ul.pagination") do
|
||||
expect(page).to have_content("1")
|
||||
expect(page).to have_link("2", href: "http://www.example.com/proposals?page=2")
|
||||
expect(page).to have_link("2", href: "/proposals?page=2")
|
||||
expect(page).not_to have_content("3")
|
||||
click_link "Next", exact: false
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user