Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 331049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:44:18+00:00 2026-05-12T09:44:18+00:00

In the application there is a default report the user see’s listing all the

  • 0

In the application there is a default report the user see’s listing all the calls for a certain phone. However, the user can select a date range to sort the list from. Doing that, everything works correctly, but when the user selects the date range and changes to the second page, the date-range is lost and it goes back to the default view for the second page.

In my controller, I’m checking to see if the date_range param is being passed in. If it isn’t, I display the entire listing, if it is, I display the records in between the certain date range.

The problem is, when I click on a new page, the new parameter doesn’t include the old date-range that it should.

How do I go about doing this, I was thinking of doing some class level variable test but that isn’t working out the way I thought. And I’m pretty stuck.

I don’t have the code right in front of me, but if I remember correctly it’s something like this:

<% form for :date_range do |f| %>
    <%= f.calendar_date_select :start %>
    <%= f.calendar_date_select :end %>
    <%= f.Submit %>
<% end %>

And in the controller, it’s something like:

if params[:date_range] == nil
    find the complete listings without a date range
else
    find the listings that are within the date range
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:44:18+00:00Added an answer on May 12, 2026 at 9:44 am

    The main problem is that you’re using a POST request when submitting the form, but will-paginate uses a GET request. You should also use form_tag instead of form_for because form_for will nest the fields in a hash which is not possible with GET.

    <% form_tag items_path, :method => 'get' do %>
      <%= calendar_date_select_tag :start_date %>
      <%= calendar_date_select_tag :end_date %>
      <%= submit_tag "Submit", :name => nil %>
    <% end %>
    

    Then check params[:start_date] and params[:end_date] directly. You’ll need to change items_path to whatever page you want the form to go to.

    This is untested but it should get you in the right direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to unload the default .NET AppDomain from an unmanaged application?
Is there any way to suppress the default js and css loaded by application.html.erb
Some where in the application there is an autogenerated query like SELECT DISTINCT `Name`,`Number`
In my application there is a LabelField with text www.google.com When the user clicks,
In Crystal reports, you can define default values for the report parameters. For example,
I have an application with three modules: default , disciplines and plans . In
In my Java application there is a Socket open and data is being read
In my application there is a ListFragment where each item from the list contains
In System.Windows.Forms.Application there are two properties called LocalUserAppDataPath and UserAppDataPath . On this computer
In the application there is a string in the following format: String elements =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.