The Basics: Let’s Make A Rails APP!
Whenever I need to create a new rails app I tend to forget the first few steps on how to get it started. Even the experts forget the basics, which inspired me to create this series called “The Basics”. This basic starter guide is ideal for someone who has some basic ruby knowledge and is now ready to dive into the world of rails or someone who just needs a quick refresher. We are going to set things up to get you started. In the next blog we will dive into more to then get something displayed on the browser.
Step 1. Make sure you’re in the correct directory (which is another word for folder) you want to create this project in. You can do that by running the command cd (enter name of directory you want to be in) . If you need to create a new directory run the command mkdir name-of-folder in your computer's terminal.
Step 2. Once you are in the right directory. Next, run the command rails new [the-title-of-your-project]. If your project has more than one word in the title, put dashes in between the words. Once you run the rails new command you will see it creating all the files.
Step 3. Next, cd into the new rails app you have created! Its empty right now but now we have created the folders that can be filled in using generators. At this point you can go ahead and run code . (Make sure there is a space between the e and the period.)
Now you have the very baseline for this project, congratulations! Next step is to build up the MVC (Model, Viewer and Controller). You will also need to fill in routes so that the the controller and viewer are connected. We will continue this in the next blog in this rails series : The Basics.
Happy Coding!