I tried the ror tutorial and I came across the following line of code:
index.html.erb:
<%= render :partial => @players %>
_player.html.erb:
<% div_for player do %>
<%= player.FNAME %> <%= player.SURNAME %>
<% end %>
players_controller.rb:
def index
@players = Player.all(:order => "FNAME")
respond_to do |format|
format.html
end
end
I want to change index.html.erb so that there is no need for partial, but it does not work properly.
Please see the code below.
index.html.erb:
<% div_for @players do %>
<%= @player.FNAME %> <%= @player.SURNAME %>
<% end %>
NoMethodError in player index #
tanya source
share