All threads / Send a parameter thru a link without including it in the URL
Ask A Question

Notifications

You’re not receiving notifications from this thread.

Send a parameter thru a link without including it in the URL

Alex Deering asked in General

This is probably a super easy solution, but for some reasonits eluding me. Im using elasticsearch and searchjoy and passing the searchid so I can track conversions to refine search results. However, I would like to not include the search id in the url in the browser and just have it in the background. Here is my link code:

<%= link_to "View", @recipes.search.present? ? recipe_path(recipe, search_id: @recipes.search.id) : recipe, class: "btn btn-secondary btn-small justify-center w-1/2 self-center mt-2", data: {action: "click->modal#linkClose"} %>

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 66,029+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.