Currently 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 displaying an array field type i.e #<User:0xa559830>.
How do I get it to display the actual users name?
I suggest rewriting the code with greater separation and clarity instead of trying to fit it all in one line. Model methods that generate SQL should never be called from views.
In the controller:
In the view:
I think the original error in your code appears to be that you were calling a block after the
wheremethod without an iterator (each).