It is a little bit strange what you are doing in your ResultsController:
@playersname = Player.all
@Resultname = Result.all
Why extracting all the players and all the results from the DB. What do you want to display in your results/index page?
Once you got all the players (not sure if it's what you need), you can loop on them and display a result the player linked to:
@players = Player.all
<% @players.each do |player|%>
<li><%= player.name %></li>
<li><%= player.result.sum%></li> #displaying just a sum as an example, but you can extract whatever you need from result object
One more time, I don't know what you'd like to display, which are your business rules and logic. It's up to you yo adapt the code. See more info at Rails guides to have an idea how to link your models together. Hope this helps.
Last edited by Javix (2012-05-25 06:15:07)