GoRails is a series of screencasts and guides for all aspects of Ruby on Rails. Learn how to setup your machine, build a Rails application, and deploy it to a server.
Implementing Edit and Update actions are straightforward now. We can reuse what we've learned with New and Create and reuse some of the logic to edit and update database records in Rails.
We now want to create new Blog Posts in our Rails app, not directly in the database. To do this, we're going to start by building a new action and form for inputting data for our Rails model.
We need a way to view individual Blog Posts on their own URLs now. That's where our Show action comes into play and we will learn how to build that in this lesson.
An index page allows us to display all the blog posts in our database. We will learn how to setup routes that point to controllers and actions that render HTML.
The first thing we need is a database table to store our blog posts. We create a Rails model (the M in MVC) to create the database and a Ruby class for us to interact with the database table.
Object oriented programming and Ruby go hand in hand. This lesson, we'll learn how to define classes and create instances of them to organize our code.
Loops allow you to run code multiple times. This is handy when you need to process a group of items one at a time until the entire group is finished. We'll also learn about Ruby blocks to define the set of operations.
A method or function is a way to define a group of code that can be used repeatedly. We'll learn how to define methods in our Ruby code and then use them multiple times.