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

  • Home
  • SEARCH
  • 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 8157131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:10:33+00:00 2026-06-06T17:10:33+00:00

I’m a RoR beginner and am using Rails 3.2.3. I have a search form

  • 0

I’m a RoR beginner and am using Rails 3.2.3.

I have a search form on my page and it performs a get request and filters the results correctly.

I want to add the possibility of also searching Products by dates.
I inserted a date_select and am able select the date and when the page refreshes after the search, the chosen dates are still there on the date_select, as I am able to get them through params.

However, my issue is that when the page renders the products, they have a link_to to their show action.
My goal is to also pass alongside the url the dates that were selected to perform the search on that link_to.

For ex, if the user selects a date of 20-06-2012 to 25-06-2012 it only shows products inserted on that time frame (and all those params are on the url)

But the link to show action of each displayed product is only:

link_to <%= link_to product.name, product%>

which renders

http://localhost:3000/products/24 (por example)

what I want to render/show is something like:

http://localhost:3000/products/24?from=20-06-2012&to=25-06-2012

The selected dates to perform the search are not stored in the database at this moment, but I will need to get them from the URL on a latter page, therefore, both dates will need to be preserved through 2 different pages before the users fills a form and then those dates are inserted in the DB.

Any tips on this? I’ve searched but all I found was on how to pass variables that exist in the model and I do not want to use cookies nor session variables.

Thanks in advance,
Regards

  • 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-06-06T17:10:34+00:00Added an answer on June 6, 2026 at 5:10 pm

    If you want to pass arbitrary parameters to the following call

    <%= link_to product.name, product %>
    

    you need to invoke the path method explicitly instead of using the implicit version. The line above is equivalent to

    <%= link_to product.name, product_path(product) %>
    

    Then you can pass parameters

    <%= link_to product.name, product_path(product, :from => 'whatever', :to => 'whatever') %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.