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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:56:37+00:00 2026-05-23T12:56:37+00:00

I wrote a form that generates a text input for each property. The list

  • 0

I wrote a form that generates a text input for each property.
The list of properties is configurable by the customer.

<% properties = ["refractivity_at_2kHz", "refractivity_at_5kHz"] %>

<% properties.each do |property| %>
  <div class="property">
    <%= f.label property %>
    <%= f.text_field property %>
  </div>
<% end %>

It fails with the error undefined method refractivity_at_2kHz.

What is the usual solution for this problem?

Should I add an array to my model, and use f.text_field myarray[property] ?

  • 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-23T12:56:37+00:00Added an answer on May 23, 2026 at 12:56 pm

    Is it a form_for(@model)?

    Because then f.text_field(property) looks for that method/property on @model.

    May be you want to change f.text_field(property) into text_field_tag(property)[1]

    cheers

    [1] http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-text_field_tag

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

Sidebar

Related Questions

I wrote a very simple web form that allows my user to view text
Using Swing in Java I wrote a form containing radio buttons, text fields and
I have a program that generates a plain text file. The structure (layout) is
I have setup a Netbeans form with a text-field bound to a bean property.
I wrote code that simply generates a table gridview. The last column provides a
I have a form that uses Richtexteditor of Flex3 to write in their reply.
Is there a stand-alone GUI designer that can read and write the .form files
I'm trying to write a dropdown form with a submit button that uses Google
I'm trying to write a regular expression that checks if an email form field
I wrote a simple contact form for a client in Django. However, whenever it

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.