Rails select helper. How do I select the default value?

Posted by Ram on Stack Overflow See other posts from Stack Overflow or by Ram
Published on 2010-05-09T18:33:55Z Indexed on 2010/05/09 18:38 UTC
Read the original article Hit count: 177

In Rails erb, am using the snippet to show visiting team in a tournament match. How do I get to initially show the current visiting_team? What am I doing wrong?

<%= f.select(:visiting_team_id, Team.all.collect{|t| [t.name, t.id] }) %>

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about web-development