I'm working on learning Rails 4 via several tutorials, and building a demo app.
I have a table called players
that links to a team
table. The team has many players, a player has only one team. So I'm using a collection_select
tag to pull the team data into the player form.
It looks like this:
<%= collection_select :player, :team_id, Team.find(:all), :id, :name, options ={:prompt => "Select a team"} %>
This works fine-- but I'd like to have the format look like "Team Name: Team City"-- I can't figure out how to concatenate the :name
and :city
values in the tag however. Is this possible?