Home>
I want you to resolve NameError.
I would like to see the naming standard, but it didn't solve it.
Thank you.
orders_controller.rb
class OrdersController</pre>
<p>index.html.erb</p>
<pre><code><% @ menu.each do | t |%>
<p><% = t.name%></p>
<% end%>
schema.rb
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 solutions
Supplemental information (FW/tool version etc.)Ruby on rails
VScode
-
Answer # 1
Related articles
- 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
Related questions
- 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
It is an error that
Class
I think you have a model fileMenus
does not exist (cannot be found).app/models/menu.rb
.Table information in DB is plural, so it is
menus
in Schema file, but Class is used in singular form, so if you do it asMenu.all
It may work.