From b928a77b62498138e241db7c8cf90245bc7c517b Mon Sep 17 00:00:00 2001 From: David White Date: Mon, 4 Sep 2017 15:13:36 +1200 Subject: [PATCH] Fix Unpermitted parameter error in log --- app/views/application/_pagination.html.erb | 6 +++--- app/views/devices/index.html.erb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/application/_pagination.html.erb b/app/views/application/_pagination.html.erb index 7711c71..24b4c62 100644 --- a/app/views/application/_pagination.html.erb +++ b/app/views/application/_pagination.html.erb @@ -16,7 +16,7 @@ <% if current_page == 1 %> ← Previous <% else %> - <%= link_to '← Previous'.html_safe, params.permit(:query, :sort).merge(page: current_page - 1) %> + <%= link_to '← Previous'.html_safe, params.permit(:query, :sort, :page).merge(page: current_page - 1) %> <% end %> <% for i in pages %> @@ -25,13 +25,13 @@ <% elsif i == 0 %> ... <% else %> - <%= link_to i, params.permit(:query, :sort).merge(page: i) %> + <%= link_to i, params.permit(:query, :sort, :page).merge(page: i) %> <% end %> <% end %> <% if current_page == total_pages %> Next → <% else %> - <%= link_to 'Next →'.html_safe, params.permit(:query, :sort).merge(page: current_page + 1) %> + <%= link_to 'Next →'.html_safe, params.permit(:query, :sort, :page).merge(page: current_page + 1) %> <% end %> <% end %> diff --git a/app/views/devices/index.html.erb b/app/views/devices/index.html.erb index c7f5c4f..0ae3f49 100644 --- a/app/views/devices/index.html.erb +++ b/app/views/devices/index.html.erb @@ -61,7 +61,7 @@ filters = { <%= render partial: 'pagination' %> -<%= link_to 'Download', params.permit(:query).merge(:format => :csv) %> +<%= link_to 'Download', params.permit(:query, :page).merge(:format => :csv) %>