NoMethodError in Store#index in Agile web Development Rails 5.1

27 Views Asked by At

While styling the app I started getting this error suddenly and have been worked on it for a day, please can anyone take a look and help with this issue, will gladly post more code if needed.

Am currently able to navigate to all urls except store/index. Btw have not touched any models or controllers while attempting to debug.

ActionView::Template::Error (undefined method `title' for nil:NilClass):
    1:
    2: <tr>
    3:   <td><%= line_item.product.title %></td>
    4:   <td class="quantity">&times;<%= line_item.quantity %></td>
    5:   <td class="price"><%= pounds(line_item.total_cost) %></td>
    6: </tr>


app/views/line_items/_line_item.html.erb:3:in 

`_app_views_line_items__line_item_html_erb__1056586022_1364061

app/views/carts/_cart.html.erb:10:in 

`_app_views_carts__cart_html_erb__758899625_136380300'

app/helpers/application_helper.rb:9:in `render_if'

app/views/shared/_navbar.html.erb:33:in 

`_app_views_shared__navbar_html_erb__342221339_136293480'

app/views/layouts/application.html.erb:21:in 

`_app_views_layouts_application_html_erb__570116043_128211120'

0

There are 0 best solutions below