I am having trouble getting the form select helper to use non-numeric
values.

The form is pasted below...  I want the f.select to have values
"home", "category", etc, not numeric values like shown.  However, it
does not seem to work to use ["Home Page", 'home'].

>From what I can find in the guides, all the examples use numeric
values.

Any ideas?

Thanks,

Andrew Pace


-------------------------------------------------------------
<% form_for(@product) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </p>
  <p>
    <%= f.label :description %><br />
    <%= f.text_area :description %>
  </p>
  <p>
    <%= f.label :specs %><br />
    <%= f.text_area :specs %>
  </p>
  <p>
    <%= f.label :price %><br />
    <%= f.text_field :price %>
  </p>
  <p>
    <%= f.label :location %><br />
    <%= f.select(:location, options_for_select([['-Select-', ''],
['Home Page', 1], ['Manufacturer Page', 2], ['Category Page', 3],
['Product Page Only', 4]], @product.location)) %>
  </p>
  <p>
    <%= f.label :tag_id %>
    <%= f.collection_select :tag_ids, Tag.find(:all, :order =>
'name'), :id, :name, {}, :multiple => true %>
  </p>
  <p>
    <%= f.submit button_label %>
  </p>
<% end %>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to