Hello,
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
(: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:
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