Learning Ruby and Rails, I’ve always had a feeling that there were many little notions that I didn’t really understand. I’m used to write things in order to learn them so here is a series of short articles about what I didn’t know.
The famous rails generate
command is part of something called the rails generators.
Rails includes a lot of generators by default and the most famous one is rails new
that allows us to create new rails applications.
You can access the list of all default generators by going into a rails app and typing rails generate
. …
Building projects with Next.js is very easy and satisfying as a React.js developer, but it might be tricky to understand how to use ENV vars and keep them safely hidden.
Next.js has already done the job for you and will automatically load your env variables from .env.local
. You will be able to access these variables by using process.env.MY_VAR_NAME
> yarn create next-app amazing-app // create a new app
> cd amazing-app
> touch .env.local // create a .env.local file
Here is what you should have in your favorite editor with two env. …
Learning Ruby and Rails, I’ve always had a feeling that there were many little notions that I didn’t really understand. I’m used to write things in order to learn them so here is a series of short articles about what I didn’t know.
MIME types stands for Multipurpose Internet Mail Extensions.
As the doc says, MIME types indicates the nature and format of a document, file, or assortment of bytes.
In other words, they are used by your web browser to know what is the type of the file it has received from the server.
When a user navigates across your website, he / she is actually making requests to your server and your server sends back the files needed through the HTTP protocol (images, json, html, javascript etc.). …
I’ve always had this feeling that while learning Ruby and Rails, there were tons of little notions that I didn’t really understood. I’m used to write things in order to learn them so here is a series of short articles about what I didn’t know.
The class Class inherits directly from Module, and adds to it all the behavior related to instances. Long story short, Modules are used to add methods to one or several Classes of your app, and Classes are used to manage your objects’ properties.
I’ve always had this feeling that while learning Ruby and Rails, there were tons of little notions that I didn’t really understood. I’m used to write things in order to learn them so here is a series of short articles about what I didn’t know.
In Ruby, what we call “numbers” are all objects from the Numeric class as we can see on the following diagram :