2

I've just executed this:

rails g scaffold Photos name:string description:string

and added paperclip to that model:

rails g paperclip Photo image

and when i go to photos/new i get this:

undefined method `model_name' for NilClass:Class

What is the problem it may be? There is @photo = Photo.new in controller, and form_for(@photo) in new.html.erb

Thank you for ahy help!

M2_
  • 217
  • 4
  • 14

1 Answers1

0

I may be wrong but I thought that scaffolding always had to use the singular in the model name; pluralizing it leads to problems. Thus it should have been Photo, not Photos:

rails g scaffold Photo name:string description:string
jschorr
  • 3,034
  • 1
  • 17
  • 20