Forum: Ruby on Rails Problem with naming a field age?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eb6042d3fdf039e9259b1a5f17db337c?d=identicon&s=25 The Ultimation (pimeamark)
on 2008-10-06 17:16
Ok basically I have a search form to search for profiles given certain
parameters. Here's what I have for part of it

  <div id="address_item" class="left">
    <%= f.label :gender %><br />
    <%= f.select :gender, Profile::GENDERS, :prompt => 'All' %>
  </div>

  <div id="address_item" class="left">
    <%= f.label :age %><br />
    <%= f.select :age, Profile::AGES, :prompt => 'All' %>
  </div>

Now the gender field defaults to 'All' when you load the page just like
the :prompt says, but for some reason the age field doesn't contain
'All' and defaults to the first value in the array. I can't figure out
why it's doing this. Both fields are exactly the same, but the age field
doesn't have 'All' as an option from the :prompt. I have a degree field
that is also the same and works properly. The problem seems to occur
within the f.select :age. If i change it to f.select :something_else it
works fine. Is there some kind of problem with naming a field age maybe?
Thanks for any help because I'm stumped on this one.
Eb6042d3fdf039e9259b1a5f17db337c?d=identicon&s=25 The Ultimation (pimeamark)
on 2008-10-06 17:59
Actually disregard that, I figured out why it was doing that. Had
nothing to do with the age field.
This topic is locked and can not be replied to.