This is my code for rendering partial (the @parties assembly is created correctly, I tested it):
<% @parties.each do |party| %>
<div class="item">
<%= render 'parties/party', :object => party %>
</div>
<% end %>
And this is the code in partial:
<%= party.name %>
However, I get the following error:
undefined method `name' for nil:NilClass
I am at my end, someone please help: - |
In addition, this is the code for the controller, which displays a view containing a partial (controller named default_controller):
def index
@parties = Party.all
end
Is it really not a fact that this is not a party_controller?
source
share