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?

1 Answer 1

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!

Sign up to request clarification or add additional context in comments.

3 Comments

this code hasnt helped at all with the problem we are having :S
With informations you gave us i don't think anybody will give you another advise. Look at the application i've linked i use there foreign key select on few places
Was the link at least helpful?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.