Ruby on Rails

Ruby is an open source object-oriented programming language, and is the substrate layer for the Ruby on Rails MVC web application framework.

This course provides a thorough introduction to the Ruby language, and then quickly moves on to show how to create Ruby on Rails web applications using the MVC architecture. The course describes how to interact with databases using ActiveRecord, including how to deal with complex associations in the data model. The course also explores important issues such as state management, JavaScript and Ajax integration, caching, and deployment.

Duration

3 days

 

Prerequisites

  • Familiarity with an OO language, e.g. Java, C#, C++, Python
  • Web development experience

What you'll learn

  • Installing Ruby on Rails
  • Writing object-oriented Ruby code
  • Implementing Ruby web applications
  • Using MVC architecture effectively
  • Database management using ActiveRecord
  • Advanced techniques
  • Best practices

Course details

Introduction to Ruby on Rails

  • Overview of Ruby on Rails
  • Installing Ruby on Rails
  • Using Ruby Version Manager (RVM)

Ruby language essentials

  • Hello World in Ruby
  • Writing object-oriented Ruby code
  • Types and variables
  • If-tests and loops
  • Methods
  • Blocks and iterators
  • Arrays and hashes

Ruby framework essentials

  • Establishing a development environment
  • Generating static web pages
  • Generating dynamic web pages
  • Layouts
  • Partials
  • Redirects and flash messages
  • Handling exceptions and errors

Implementing MVC solutions

  • Overview of Model View Controller architecture
  • Convention over configuration in Rails
  • Managing forms
  • Best practices

Database management and ActiveRecord

  • Creating a database model
  • Adding records
  • Populating the database
  • Implementing search queries
  • Editing and deleting records
  • Validation
  • Scope

Implementing associations

  • Overview of associations
  • 1-1 associations
  • 1-many associations
  • Many-many associations
  • Polymorphic associations

Scaffolding

  • Overview of scaffolding
  • Creating a scaffold
  • Defining routes
  • Implementing the controller
  • Implementing views

Going further with routes

  • Route naming conventions
  • Specifying parameters
  • Defining route constraints
  • Managing redirects
  • Selecting specific routes

State management

  • Cookies
  • Session
  • Configuring session state

Using JavaScript

  • The role of JavaScript in Rails
  • Using jQuery
  • Using CoffeeScript
  • JavaScript helpers
  • Ajax

Additional techniques

  • Caching
  • Bundling
  • Internationalization
  • Testing
  • Deployment