Home > Net >  index.html.haml Ruby on Rails
index.html.haml Ruby on Rails

Time:07-14

index.html.haml where line #3 raised: undefined method `each' for nil:NilClass

Projects #Index

**= @projects.each do |project|**
= project.name
%br

CodePudding user response:

I think because @projects in nil try to add some data after that use that page or you can add condition like if @projects.present? than you can show

  • Related