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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:57:57+00:00 2026-06-07T18:57:57+00:00

I have an application in Rails 3.2.1 with a model which has a column

  • 0

I have an application in Rails 3.2.1 with a model which has a column of serialized params called :options.

In my form, I am using the following code (and it works) to list the options when the user is registering. I need to use the serialized options for this because we will need to capture different data in different circumstances.

<% @options.each do |key, value| %>
    <%= f.fields_for :options do |options| %>
        <%= options.label key %> 
        <%= options.text_field key, :value => value %>
    <% end %> 
<% end %>

The code works fine, but the field labels are coming out in lowercase instead of preserving their case:
1) street address

<label for="registration_options_2)_City_State,_Zip">2) city state, zip</label>
<input id="registration_options_2)_City_State,_Zip" name="registration[options][2)_City_State,_Zip]" size="30" type="text" value="" />

<label for="registration_options_3)_Contact_phone_number">3) contact phone number</label>
<input id="registration_options_3)_Contact_phone_number" name="registration[options][3)_Contact_phone_number]" size="30" type="text" value="" />

I’ve tried using <%= options.label key.capitalize %> or <%= options.label key.titlecase %> to no avail. It appears the label tag is the culprit and not the key. As in the output code, the key’s case is fine. It’s what comes out of the label tag that’s not.

Suggestions? Thanks in advance!

  • 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-07T18:57:59+00:00Added an answer on June 7, 2026 at 6:57 pm

    If you want all labels in your forms to be capitalized you could just use css:

    label { text-transform: capitalize; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a model in my rails application which is class Person < ActiveRecord::Base
I have STI models in my Rails application. The ancestor model has validations with
In a rails application, I have a number of attributes for a model called
I have a relationship table in a rails application called edit_privileges , in which
I have a Rails project which has a Postgres database for the actual application
I have an existing Rails 3.1 application with a model Products with price, description,
I'm using Ruby on Rails to develop a web application. I have a wiki
I have the following code in one of my controllers (in a Rails 3.1
I have an application which has projects and users . I don't care about
I am working on an ASP.NET MVC application which has a model for a

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.