RailsCasts Pro episodes are now free!

Learn more or hide this

Luis Vasconcellos's Profile

GitHub User: vasconcelloslf

Site: http://luisvasconcellos.com

Comments by Luis Vasconcellos

Avatar

Hey, I keep getting these error on everything I try to do, products index, show and when I try to save a product. Any ideas ?

ruby
ActionView::Template::Error (undefined method `[]' for nil:NilClass):
    9:     <th></th>
    10:   </tr>
    11: 
    12: <% @products.each do |product| %>
    13:   <tr>
    14:     <td><%= product.name %></td>
    15:     <td><%= product.price %></td>
  app/views/products/index.html.erb:12:in `_app_views_products_index_html_erb___1596621271634774456_70157459562860'
  app/controllers/products_controller.rb:7:in `index'

nil:NilClass