Ask A Question

Notifications

You’re not receiving notifications from this thread.

Getting undefined Local var method model_resource_name on Rails g Scaffold Model

Megazoor asked in Rails

Running
$ rails g scaffold Poop

returns:

Running via Spring preloader in process 13525
invoke active_record
create db/migrate/20181928173828_create_models.rb
create app/models/model.rb
invoke test_unit
create test/models/model_test.rb
create test/fixtures/models.yml
invoke resource_route
route resources :models
invoke scaffold_controller
create app/controllers/poops_controller.rb
invoke erb
create app/views/models
create app/views/models/index.html.erb
create app/views/models/edit.html.erb
create app/views/models/show.html.erb
create app/views/models/new.html.erb
create app/views/models/_form.html.erb
(erb):1:in template': undefined local variable or methodmodel_resource_name' for #Erb::Generators::ScaffoldGenerator:0x007fa59de06e48 (NameError)
from /Users/username/.rubies/ruby-2.4.1/lib/ruby/2.4.0/erb.rb:896:in eval'
from /Users/username/.rubies/ruby-2.4.1/lib/ruby/2.4.0/erb.rb:896:in
result'

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.