Premium Content - Free Preview
The Ruby for Rails Tutorial went over Ruby and built a simple Rails-style app. The Ruby on Rails Overview introduced the different parts of Rails, and now it's time to code your own Rails application. This tutorial will just focus on the data side of a web application, so you can store and retrieve data from a command line, but without a web interface. Future tutorials will show how to turn this start into a complete web application.
Beginners often run into issues when setting up Rails on their computer, so the easiest way to get started is to use a cloud IDE, an online development environment. Cloud9 is a powerful cloud IDE with a good free tier, so sign up for an account.
Here's some brief instructions to get started:
- Sign up for an account on c9.io
- Click CREATE NEW WORKSPACE > Clone from URL
- Paste in the following URL https://github.com/Learneroo/automated-store.git, click on "Ruby" and click "Create".
- Once the environment is set up, click on "Start editing"
This will open the Cloud9 editor so you can start developing your project! There are a lot of folders and files that Rails provides, but don't worry about them now.
The terminal (on the bottom of cloud9) is where you enter Rails commands. To complete the installation of this Rails app, enter the following in the terminal:
Rails will then install the ruby libraries that your application uses.
Web Applications and Databases
We're going to build an application for storing and retrieving product data. Each product should have a name, a description and a price. The application should let an administrator Create product records, Retrieve/Read them, Update them, and Delete them. These 4 actions are called CRUD, and they're the main thing web applications do. Standard web applications save information (such as products or status updates) in a database for people to read, and perhaps update or delete.