I have the following code in the little application that I am writing. It is basically taken directly out of the Agile Web Development with Rails book.
In the controller:
@exercises = Exercise.find
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?