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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:00:34+00:00 2026-06-12T07:00:34+00:00

I have a form, that when POSTed, renders another form. What I would like

  • 0

I have a form, that when POSTed, renders another form. What I would like to do is to pass the parameters from the first form, into certain hidden fields of the second form.

The second form is using a form_for form helper, and what I’m trying to do is to get it to accept the parameters that are being posted to it.

Here’s what the form looks like:

    <%= form_for(@phone) do |f| %>
        <%= f.hidden_field :original_number, params[:original_number] %>


        <%= f.hidden_field :name, params[:name] %>
        <%= f.hidden_field :twilio_number,  number.phone_number %>

        <div class="found_list">
            <div class="found_phone_number">
                <%= f.label :number, number.friendly_name) %>
            </div>
            <div class="choose_found_number">
            <%= f.submit "Choose This Number", :class => "btn btn-large btn-success" %>
            </div>
        </div>
            <hr>
    <% end %>

When I do something like

<%= f.hidden_field :original_number, params[:original_number] %>

The action gives me the error:

NoMethodError in Find_numbers#create

Showing C:/Sites/dentist/app/views/phones/new.html.erb where line #17 raised:

undefined method `merge' for "1231231234":String

The “1231231234” is the parameter that is being POSTed to the form, but it doesn’t seem to accept it.

Do you have an idea of how I would get the form to accept the parameter?

When I removed the params[], the error doesn’t happen, but the parameters also don’t populate in the hidden fields.

  • 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-12T07:00:36+00:00Added an answer on June 12, 2026 at 7:00 am

    second parameter in hidden_field should be an option hash, not a value

    <%= f.hidden_field :original_number, :value => params[:original_number] %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that has label values that I would like to pass
I would like to have a form that gets output into a table. The
I have a form that includes the first name and last name of a
I have a form that saves the price into the database but whn a
I have a form that is being serialized by JQuery and posted via .ajax()
I have a form that creates a new entry into a database. One of
I have a regular form that gets POSTed to a controller. Dates must be
Normally we have a static form that is posted on the server and since
I have a form that allows a user to select a county from a
I currently have form that checks if a user has unsubmitted changes when they

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.