F
F
flu3r2015-04-30 13:27:54
Ruby on Rails
flu3r, 2015-04-30 13:27:54

When deleting a product, it gives an error, how to solve?

I am engaged in the book "rails 4 agile web application development" in chapter 11, I ran into a problem.
when empty cart is clicked in the generated left menu:
Showing /depot/app/views/layouts/application.html.erb where line #17 raised:
'nil' is not an ActiveModel-compatible object. It must implement :to_partial_path.
complains about :
<%= render @cart %>
before chapter 11 edits everything worked.
I've been suffering for two days now :(

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Viktor Vsk, 2015-04-30
@viktorvsk

'nil' is not an ActiveModel-compatible object.

What do you think this phrase means?

F
flu3r, 2015-04-30
@flu3r

there are just suspicions that the book was silent about this error, because after 20 pages it fixes this error, only related to the /products section

R
Renat Ibragimov, 2015-05-05
@MpaK999

<%= render @cart if @cart %>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question