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 8806347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:06:24+00:00 2026-06-14T02:06:24+00:00

i have the problem, that i want to pass custom url params to the

  • 0

i have the problem, that i want to pass custom url params to the form_tag method.
i have tried many ways explained at stackoverflow, but no one seems to be correct for rails 3.2.8.

This is my current:

<%= form_tag search_results_path,
             :method => "get",
             :params => params.merge(:button => "..."),
             class: "form-search" do %>

This doesn’t work too:

<%= form_tag search_results_path,
             :method => "get",
             :params => params.except(:controller, :action).
                        merge(:button => "..."),
             class: "form-search" do %>

But when search_results_path finish loading, params[:button] is not set.

Thanks for your help.

EDIT:

I try to render a form in a view, which has action="/search/params?button=xxx. This should be the initial state for my tabs and every time the page gets reloaded, this url param should be passed too, to provide my current tab.

  • 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-14T02:06:24+00:00Added an answer on June 14, 2026 at 2:06 am

    dude, please explain WHAT you are trying to do, not how.
    You don’t pass parameters to a form, that does not make sense .
    Explain what is your goal and I may be able to help you.

    If you want to pass parameters from url to your controller through the form, you just create a hidden field set its value with params[:param_name]

    EDIT==============

    You have to use url_for or polymorphic_path to generate url with parameters.
    Like:

        form_tag(:url => url_for(...path_with_parameters))
    

    or

    form_tag(:url => polymorphic_path(...path_with_parameters))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

with my RCP program I have the problem that I want to have more
I have the following problem that I want to solve in awk. I have
My problem is that I want to have a tab bar view with its
I have a problem with my site. I want that the shadow stops at
I have problem with fancybox. I want to write a function that will run
My problem is simple: I have a long list of elements that I want
I have a big problem. I want to extract text from html table that
I have the following problem. I want to check that the item clicked on
I have a problem(again)...now i want to pass a String from one Activity to
I have a method that I want to be transactional in the abstract sense.

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.