In Rails erb, I use a snippet to show the invited team in a tournament match. How do I show the current visit_team first? What am I doing wrong?
<%= f.select(:visiting_team_id, Team.all.collect{|t| [t.name, t.id] }) %>
The fix is to explicitly indicate the selected option. Now it looks like it likes and works
<%= f.select(:visiting_team_id, Team.all.collect{|t| [t.name, t.id]}, {:selected => @match.visiting_team_id.to_i}) %>
Just make sure the object you pass in form_forhas the correct set visiting_team_id. Then, while there is a command that is pulled with this identifier, it should work
form_for
visiting_team_id
Source: https://habr.com/ru/post/1744691/More articles:Android 2.1 running gesture captured in text mode, but still the context menu opens - androidFlex Builder 4, ZendAMF, and Data Services - Error? - eclipseКак я могу получить название выбранного UISegment в UISegmentControl? - objective-cSaving related model objects - djangorails 2.3.4 "Template missing" when using haml - ruby-on-railsForEach with EditorFor - c #Difference between C ++ keyboard code and JAVA KeyEvent keyboard key - javaEntity Framework 4.0 - ссылка только для кода - entity-framework-4ASP.NET 4.0 Web Form Routing - c #iTunes Track Location Software Update - applescriptAll Articles