[RUBY] About self-introduction and common errors

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

It is an "error that beginners often fall into".

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.

・ Errors that beginners get can be found by using commands and debugging tools.

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

About self-introduction and common errors
Git and GitHub ~ How to fix common errors ~
About Bean and DI
About classes and instances
About redirect and forward
About Serializable and serialVersionUID
About for statement and if statement
About synchronized and Reentrant Lock
Ruby syntax errors and countermeasures
About errors during SNS authentication
Common processing and error processing springmvc
[Java] About String and StringBuilder
About the same and equivalent
About classes and instances (evolution)
About pluck and ids methods
Consideration about classes and instances
About Java Packages and imports
About Ruby and object model
About Ruby classes and instances
About instance variables and attr_ *
About C # lambda expressions and Linq
About Java static and non-static methods
About fastqc of Biocontainers and Java
Learn more about gems and bundlers
About the equals () and hashcode () methods
[Java beginner] About abstraction and interface
About Ruby single quotes and double quotes
About Gradle's setup phase and execution phase
About go get and go install from Go1.16
About removeAll and retainAll of ArrayList
About if statement and branch processing
About object-oriented inheritance and about yield Ruby
About Java primitive types and reference types
This and that about Base64 (Java)
About Docker, disguise server and container