Created
May 30, 2018 08:58
-
-
Save goodviber/b7b93bc9efc1bf416ee02accc2f69dfd to your computer and use it in GitHub Desktop.
page param for will paginate ajax calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def edit | |
if !!(request.referrer[-1] =~ /\A\d+\z/) | |
@page = request.referrer[-1] | |
else | |
@page = 1 | |
end | |
end | |
############## form ################ | |
<%= form_tag admin_delivery_path, method: :put, remote: true, html: { style: "display:inline;" } do |f| %> | |
<div class="modal-body"> | |
<ul class="errors"></ul> | |
<%= hidden_field_tag :page, @page %> | |
........ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment