Creating a New Rails Project

As you probably already know, a few months ago, I completed a coding bootcamp where I learned a few coding languages. One of them being Ruby on Rails – It’s been awhile since I’ve created a Rails application so I decided to create a banking app where users can log in, make deposits and withdrawals, update their profile and possibly down the line make it so a user can apply for a loan. The purpose of starting this project is to use the skills I don’t want to lose – as the saying goes “Use it or lose it”…I don’t want to lose it.

The inspiration from the project comes from the hackathon I helped organize last month (, many of the participants utilized Rails and I kept thinking to myself ‘It’s been awhile since I created anything in Rails’ so I decided to create this project.

I also have a full time job as a Business Systems Analyst (more details on this in a later post) so I’m working on this project in my down time, namely when I get home from work so it will be a slow moving project.

Finally, I have never fully used my blog as a teaching platform/a way to communicate to others what I learned so I wanted to at least start with creating a new rails application because when I started this project, I definitely had to go back and look up how to get the project up and running & thus thought this would be a great way to write out how to start it so that next time I can use it as a reference. Fortunately, the process is not that difficult if you already have rails installed on my computer.

**Please note: This tutorial assumes you have rails up and running on your computer.**

  1. Navigate to the folder in the terminal where you want the new project
  2. In the terminal, create a new rails project: rails new project_name
  3. Navigate to the newly created project from the terminal: cd project_name
    1. Start the server for the project: In a new tab in the terminal (ctrl + N) – type in rails s to boot up the server
    2. In your browser of choice, go to localhost:3000
      1. You should see the generic message from RailsGeneric Rails Message
  4. Open the project in your favorite text editor, I use Atom…Then, locate and open the views folder views folder
    1. From there right click and New Folder – Since I’m creating a banking application, I’m going to create a users folder to store all views related to users.
    2. Once the folder is created, right click on the folder name to select New File:
      1. Name the file any name of your choice. Since, I’m looking to have a fully RESTful application, I’m going to name my file index.html.erb
        1. In this file, create an h1 tag – <h1>My Index Page </h1> – Save the file. **Please not that if you try to view the page in your browser you would still see the generic Rails screen because this route is not defined in our routes folder. **
  5. Let’s define this route so we can view it: Open the routes.rb file (folder_name –> config –> routes.rb)
    1. Add a line in the file after line 6 in order to have a statement of code to make the new file you just created be the root of your website – That is, when you navigate to localhost:3000 this page shows up instead of the generic page from Rails that’s currently showing.
    2. Once you are on a new line, the format for how to create the root is: root:folder_name#file_name
      1. The folder_name will be what you named the folder from above – in my case it’s users
      2. The file_name will be the file that you created from above – in my case it’s index since I named the file index.html.erb
      3. In the end my statement looks like this: root:users#index
      4. Save the changes to this file.
  6. Back in your browser: Refresh the page and you should now see the h1 tag in your newly created file
  7. That’s it! You are now ready to work on your rails project.
  8. Next, we’ll create a model and controller for our project.