We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seems that association method does not use non-standard primary key even if it is defined in the model.
This works: <%= f.association :game, :collection => Game.multiplayer.order('name'), :value_method => Game.primary_key %>
This doesn't: <%= f.association :game, :collection => Game.multiplayer.order('name') %>
Is this intended behavior or a bug?
The text was updated successfully, but these errors were encountered:
You need to pass an array to collection, with label and value methods... Please try:
Game.multiplayer.order('name').map{|game| [game.name, game.my_pk_attr] }
There is no support for passing an AR collection, but you could try a patch =).
Sorry, something went wrong.
Ok, thank you. ...thinking of doing a patch... :)
No branches or pull requests
It seems that association method does not use non-standard primary key even if it is defined in the model.
This works:
<%= f.association :game, :collection => Game.multiplayer.order('name'), :value_method => Game.primary_key %>
This doesn't:
<%= f.association :game, :collection => Game.multiplayer.order('name') %>
Is this intended behavior or a bug?
The text was updated successfully, but these errors were encountered: