Other Pages

Getting Started

Goals

  • Create a new rails application

Steps

Step 1

In the termine, go to a folder where we want to put the source code. There run

Type this in the shell:
rails new suggestotron

Step 2

a folder suggestotron with a lot of files and folders was created. Let's look inside

Type this in the shell:
cd suggestotron/

Step 3

In this folder we will run commands later, and we want to start an editor. for example VS Code:

Type this in the shell:
code .

In VS Code, you can see the files on the left hand side it should show the folders of your app in a tree structure:

Screenshot of your files

You can see that rails new created a lot folders and files. The ones we want to focus on today are:

File/Folder Purpose
app/ Contains the controllers, models, and views for your application. You will do most of your work here.
config/ Configure your application's runtime rules, routes, database, and more.
db/ Shows your current database schema, as well as the database migrations.
public/ The only folder shown to the world as-is. If you put files in here, they will be served directly on the web without any processing by Rails. Us it for your sites logo or robots.txt file

There is a lot more that in your Rails app. Probably enough to fill a book, so we're going to ignore them for now.

Next Step: