Hello! First of all, I would like to briefly introduce myself.
My name is mizutani and I am a programming beginner!
After experiencing sales for manufacturers for about two years, I started learning in earnest. I've always liked programming, and since I was a college student I've been reading and learning simple HTML, CSS, and Javascript books. The opportunity was an intern who participated when he was in the second year of college. Having won the business contest, I found it interesting to think about business ideas, so I started learning from there. I also studied the front end for a month at Tech Academy.
However, due to the influence of those around him, he became a major player and became a company unrelated to new businesses. The sales were fun and the results were good, but I decided to take the plunge and take on the challenge lol
However, it's been about 2 months since I started touching ruby. I am working on it every day through trial and error.
The theme I write is
I'm glad that more and more people are learning programming these days. It's encouraging in the sense that it simply increases the number of friends. I think there are many people who get sick of errors. (I also had a frustration when I was a high school student lol)
If you keep in mind the common errors there, the barrier to learning may be lowered as much as possible. I thought.
Let me introduce two!
①no method error
This is probably the most common.
There are two common causes:
-The method has not been defined. -The object does not contain the necessary information.
I forgot to put the foreign key value in the instance variable and got a no method error lol At that time, I was convinced that the price would come in without permission. (If you don't have a foreign key value, you can't associate and you can't use methods.) However, if you use binding.pry etc., you can see the contents in one shot, so If you have any problems, check it out! (The rails tutorial mentions binding.pry, so check it if you have any problems.)
②routing error
This is also common. However, this can also be solved by using the rails routes command in the terminal. (Command to check the currently set routing)
-Error in the argument of the link_to method ・ Route description error -Form_with helper method argument mistake
If you want to know the contents of the request, you can do it by entering params after using binding.pry.
This is the end of the introduction, but I think you have learned a little about the following.
Of course, the harder it gets, the more difficult the error will be. However, if you are just starting out, it would be better to learn how to use the debug tool once.
I also say with a big face, but I wrote this article with my own caution!
Let's continue to do our best with each other! !!
Recommended Posts