I want you to resolve NameError.
I would like to see the naming standard, but it didn't solve it.
class OrdersController</pre> <p>index.html.erb</p> <pre><code><% @ menu.each do | t |%> <p><% = t.name%></p> <% end%>
ActiveRecord :: Schema.define (version: 2019_11_30_132114) do create_table "menus", force:: cascade do | t | t.integer "orderid" t.string "name" t.integer "number" t.boolean "receive" t.datetime "created_at", null: false t.datetime "updated_at", null: false end end
Search for similar questions such as StackOverflow and execute solutionsSupplemental information (FW/tool version etc.)
Ruby on rails
Answer # 1
It is an error that
ClassI think you have a model file
Menusdoes not exist (cannot be found).
Table information in DB is plural, so it is
menusin Schema file, but Class is used in singular form, so if you do it as
Menu.allIt may work.
- ruby on rails 6 - [error] uninitialized constant user (call'userconnection' to establish a connection) :: image
- ruby - nameerror uninitialized constant drinkscontroller :: drinktag
- ruby on rails uninitialized constant error
- ruby - tag posts uninitialized constant post :: tagrelationship
- ruby - i want to resolve an error when installing gem byebug
- ruby on rails - nomethoderror in itemscontroller # new error
- ruby - i got a routing error when i sent a comment
- ruby on rails - i get an error without being created
- ruby on rails 6 - when i press new user registration, i get an error of no route matches [get] "/ users"
- ruby - i entered secret_key_base, but http error 500 cannot be resolved
- ruby - i get an error with a single test code for a model
- ruby on rails - error when implementing rails6 follow function
- ruby on rails - i get an error with rails db: create
- ruby error code
- ruby - i got "mysql2 :: error :: connectionerror: plugin caching_sha2_password could not be loaded "
- ruby - validation error when saving intermediate table
- ruby - http error 500 error occurred in aws deployment, but the cause cannot be determined
- ruby on rails 6 - about rails routing error no route matches [get] "/"
- ruby on rails - i get an error in a program that changes over time
- ruby on rails - i don't understand the content of the error
- ruby - passing variables using render partial
- ruby - gem devise (top page (login form input)) → list screen
- ruby - i get an error with the rails new command
- ruby - implementation of friendly forwarding
- ruby - i installed carrierwave with rails, but i can't see the image
- ruby - about rails controller new action
- ruby - rails page does not open
- [ruby] i'm having trouble with nomethoderror
- ruby - [search function] acquisition of products associated with users
- ruby - even if each statement is used, the contents of the db cannot be displayed in order and an error occurs