0

current i am trying to restrict the information feed into an option select field to only display the criteria i have selected. with the code below this seems to be working

         = select("schedule", :selected_players, User.where(:team_id => current_user[:team_id]) { |p| [full_name(p), p.id] }, {:include_blank => 'None', :prompt => 'Add Players to Lineup'}, :multiple => "multiple")

the issue is that this code is display an array field type i.e #<User:0xa559830>

how do i get it to display the actual users name?

Boss Nass
  • 3,384
  • 9
  • 48
  • 90

1 Answers1

1

Define .to_s method in model

Like here https://github.com/roolo/mwstt/blob/master/app/models/project.rb#L7

Also all the mapping and searching logic should be placed in model as method which you'll just call in view, or prepare it in controller!

Mailo Světel
  • 24,002
  • 5
  • 30
  • 40