Mark Hapke


20 Experience
0 Lessons Completed
0 Questions Solved


Posted in Rails Application Templates Discussion


I came across an error when I was trying to generate a scaffold:
(erb):1:in `template': undefined local variable or method `model_resource_name' for #<Erb::Generators::ScaffoldGenerator:0x00007fd4e005ccf8> (NameError)

I had to replace every occurrence of model_resource_name with singular_name in the file lib/templates/erb/scaffold/_form.html.erb in the newly created app folder. 
<%%= form_with(model: <%= model_resource_name %>, local: true) do |form| %>
<%%= form_with(model: <%= singular_name %>, local: true) do |form| %>

Best regards,

Posted in Rails & Vue.js Trello Clone - Part 1 Discussion

HI there, 

i had the problem too. Could fix it with:
yarn install

If you have get the message "can't find executable webpack for gem webpacker" along the way you can fix it with:
bundle exec rails webpacker:binstubs

Hints came from:

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.