Hello,
I have the following code in the little application that I am writing.
It is
basically taken directly out of the Agile Web D. with Rails
book.
In the controller:
@exercises = Exercise.find(:all).map { |f| [f.name, f.id] }
And in the view
<% form_tag :action => ‘create’ do %>
…
Exercise: <%= select_tag(:id,
@exercises)
%>
<% end %>
And this is what it is producing:
Exercise: Incline
Dumbbell Press1Push-up2Squats3Incline Dumbbell
Press4Push-up5Squats6asdfasdf7another
test8asdfasdfasdfasdfasdf12349asdfasdfasdfasdfasdf123410111test exercise
no description12testing error stuffs13
This is obviously not what I was expecting. It makes it really hard to
pick
something from what I thought would be a nice little drop down select
widget.
What am I doing wrong?
Thanks,
Chris
You know you’ve achieved perfection in design, Not when you have nothing
more to add, But when you have nothing more to take away.
– Antoine de Saint-Exupery