Ruby on Rails for Beginners
  • ondemand_video
       Video Length : 27h26m24s
  • format_list_bulleted
       Tasks Number : 144
  • group
       Students Enrolled : 159
  • equalizer
       Medium Level
Authors

Kevin Gautama is a systems design and programming engineer with 16 years of expertise in the fields of electrical and electronics and information technology.

He teaches at the Hanoi University of Industry in the period 2003-2011 and he has a certificate of vocational training by the Ministry of Industry and Commerce and the Hanoi University of Industry.

From extensive design experience through numerous engineering projects, the author founded the Enziin Academy.

The Enziin Academy is a startup in the field of educational, it's core goal is to training design engineers in the fields technology related.

The Enziin Academy is headquartered in Stockholm-Sweden with an orientation operating multi-lingual and global.

The author's skills in IT:

  • Implementing the application infrastructure on Amazon's cloud computing platform.
  • Linux server system administration (Sysadmin).
  • Design load balancing and content distribution system.
  • MySQL database administration.
  • C/C++/C# Programming
  • Ruby and Ruby on Rails Programming
  • Python and Django Programming
  • The WPF/C# on the .NET Framework Programming
  • The PHP/JAVA Programming
  • Machine Learning and Expert System.
  • Internet of Things.

The author's skills in the fields of electric and electronic:

  • The design of popular CPU / MCU systems.
  • Design FPGA / CPLD system (Xilinx - Altera).
  • Design and programming of DSP systems (Texas Instruments).
  • Embedded ARM system design.
  • The RTOS Programming
  • Design and programming electronic power systems.
  • PLC - inverter - sensor - electric control cabinet industrial.
  • Control systems distributed connection with Server.

Read more...

  • Curriculum
  • 1. Introduction
    • videocam
      Introduction to Ruby on Rails

      11m26s
    • videocam
      Install Ruby on Rails on Ubuntu

      11m26s
    • videocam
      Install Ruby on Rails on MacOS

      11m26s
    • videocam
      Install Ruby on Rails on Docker

      11m26s
    • videocam
      Setup the IDE and GIT

      11m26s
  • 2. Ruby on Rails Basic
    • videocam
      The basic principles of MVC

      11m26s
    • videocam
      Create the Blog app

      11m26s
    • videocam
      Creating the Article Model

      11m26s
    • videocam
      Running a Migration

      11m26s
    • videocam
      Adding Some Validation

      11m26s
    • videocam
      Creating the Article Controller

      11m26s
    • videocam
      Creating the view pages for Article

      11m26s
    • videocam
      Creating the Category model

      11m26s
    • videocam
      Associating Article and Category

      11m26s
    • videocam
      Configure routes

      11m26s
    • videocam
      Running Rails Console

      11m26s
    • videocam
      Adding Avatar Image for Article

      11m26s
    • videocam
      Install Material Design

      11m26s
  • 3. Rails Model
    • videocam
      Active Record Basics

      11m26s
    • videocam
      Convention over Configuration in Active Record

      11m26s
    • videocam
      Creating Active Record Models

      11m26s
    • videocam
      Overriding the Naming Conventions

      11m26s
    • videocam
      CRUD: Reading and Writing Data

      11m26s
    • videocam
      Rollback/Reset Migration

      11m26s
    • videocam
      Schema Dumping

      11m26s
    • videocam
      Validations Model

      11m26s
    • videocam
      Callbacks in Model

      11m26s
    • videocam
      Active Record Associations

      11m26s
    • videocam
      Active Record Query Interface

      11m26s
  • 4. Rails Views
    • videocam
      Rendering by Default

      11m26s
    • videocam
      Using render

      11m26s
    • videocam
      Using redirect_to

      11m26s
    • videocam
      Using head To Build Header-Only Responses

      11m26s
    • videocam
      Asset Tag Helpers

      11m26s
    • videocam
      Understanding yield

      11m26s
    • videocam
      Using the content_for Method

      11m26s
    • videocam
      Using Partials

      11m26s
    • videocam
      Using Nested Layouts

      11m26s
  • 5. Rails Controllers
    • videocam
      Controller Naming Convention

      11m26s
    • videocam
      Methods and Actions

      11m26s
    • videocam
      Parameters in Controller

      11m26s
    • videocam
      Session and Cookies

      11m26s
    • videocam
      Rendering XML and JSON data

      11m26s
    • videocam
      Filters in Controller

      11m26s
    • videocam
      Request Forgery Protection

      11m26s
    • videocam
      The Request and Response Objects

      11m26s
    • videocam
      HTTP Authentications

      11m26s
    • videocam
      Streaming and File Downloads

      11m26s
    • videocam
      Log Filtering

      11m26s
    • videocam
      Rescue

      11m26s
    • videocam
      Force HTTPS protocol

      11m26s
  • 6. Rails Router
    • videocam
      Resource Routing

      11m26s
    • videocam
      Non-Resourceful Routes

      11m26s
    • videocam
      Customizing Resourceful Routes

      11m26s
    • videocam
      Inspecting and Testing Routes

      11m26s
  • 7. Action Mailer
    • videocam
      Generating a Mailer

      11m26s
    • videocam
      Auto encoding header values

      11m26s
    • videocam
      Complete List of Action Mailer Methods

      11m26s
    • videocam
      Mailer Views

      11m26s
    • videocam
      Action Mailer Layouts

      11m26s
    • videocam
      Previewing Emails

      11m26s
    • videocam
      Generating URLs in Action Mailer Views

      11m26s
    • videocam
      Adding images in Action Mailer Views

      11m26s
    • videocam
      Sending Multipart Emails

      11m26s
    • videocam
      Sending Emails with Dynamic Delivery Options

      11m26s
    • videocam
      Sending Emails without Template Rendering

      11m26s
    • videocam
      Sending Emails with Gmail SMTP

      11m26s
    • videocam
      Sending Emails with Amazon SES

      11m26s
    • videocam
      Receiving Emails

      11m26s
    • videocam
      Action Mailer Callbacks

      11m26s
    • videocam
      Using Action Mailer Helpers

      11m26s
    • videocam
      Mailer Testing

      11m26s
    • videocam
      Intercepting Emails

      11m26s
  • 8. Active Job
    • videocam
      Creating a Job

      11m26s
    • videocam
      Job Execution

      11m26s
    • videocam
      Queues in Job

      11m26s
    • videocam
      Callbacks in Job

      11m26s
    • videocam
      Internationalization

      11m26s
    • videocam
      GlobalID

      11m26s
    • videocam
      Exceptions

      11m26s
    • videocam
      Job Testing

      11m26s
    • videocam
      Using Sidekiq

      11m26s
    • videocam
      Using Whenever

      11m26s
  • 9. Testing and Debug in Rails
    • videocam
      Introduction to Testing

      11m26s
    • videocam
      The Test Environment

      11m26s
    • videocam
      Rails meets Minitest

      11m26s
    • videocam
      Rails Specific Assertions

      11m26s
    • videocam
      The Test Database

      11m26s
    • videocam
      Model Testing

      11m26s
    • videocam
      System Testing

      11m26s
    • videocam
      Integration Testing

      11m26s
    • videocam
      Functional Tests

      11m26s
    • videocam
      Testing Routes

      11m26s
    • videocam
      Testing Views

      11m26s
    • videocam
      Testing Helpers

      11m26s
    • videocam
      Testing Your Mailers

      11m26s
    • videocam
      Testing Jobs

      11m26s
    • videocam
      Testing Resources

      11m26s
    • videocam
      Using RSpec

      11m26s
    • videocam
      Using Capybara

      11m26s
    • videocam
      View Helpers for Debugging

      11m26s
    • videocam
      The Logger

      11m26s
    • videocam
      Debugging with the byebug gem

      11m26s
    • videocam
      Debugging with the web-console gem

      11m26s
    • videocam
      Debugging Memory Leaks

      11m26s
  • 10. Action Cable
    • videocam
      Introduction to Action Cable

      11m26s
    • videocam
      Introduction to Publish/Subscribe

      11m26s
    • videocam
      Server-Side Components

      11m26s
    • videocam
      Client-Side Components

      11m26s
    • videocam
      Client-Server Interactions

      11m26s
    • videocam
      Example 1: User Appearances

      11m26s
    • videocam
      Example 2: Receiving New Web Notifications

      11m26s
    • videocam
      Configuration Subscription

      11m26s
    • videocam
      Running Standalone Cable Servers

      11m26s
    • videocam
      Build the chat realtime app

      11m26s
  • 11. Rails for API-only Applications
    • videocam
      What is an API Application?

      11m26s
    • videocam
      Why Use Rails for JSON APIs?

      11m26s
    • videocam
      The Basic Configuration

      11m26s
    • videocam
      Choosing Middleware

      11m26s
    • videocam
      Choosing Controller Modules

      11m26s
  • 12. Ruby on Rails Security
    • videocam
      Session ID

      11m26s
    • videocam
      Session Hijacking

      11m26s
    • videocam
      Session Guidelines

      11m26s
    • videocam
      Session Storage

      11m26s
    • videocam
      Replay Attacks for CookieStore Sessions

      11m26s
    • videocam
      Session Fixation

      11m26s
    • videocam
      Session Fixation - Countermeasures

      11m26s
    • videocam
      Session Expiry

      11m26s
    • videocam
      Cross-Site Request Forgery (CSRF)

      11m26s
    • videocam
      Redirection and Files Security

      11m26s
    • videocam
      User Management Security

      11m26s
    • videocam
      Injection

      11m26s
    • videocam
      Unsafe Query Generation

      11m26s
    • videocam
      Environmental Security

      11m26s
  • 13. Internationalization
    • videocam
      How I18n in Ruby on Rails Works

      11m26s
    • videocam
      Setup Internationalization

      11m26s
    • videocam
      Internationalization and Localization

      11m26s
    • videocam
      Overview of the I18n API Features

      11m26s
    • videocam
      Custom Translations

      11m26s
    • videocam
      Customize your I18n Setup

      11m26s
  • 14. Deploy Application
    • videocam
      Install a Linux Server

      11m26s
    • videocam
      Deploy the application manually

      11m26s
    • videocam
      Deploy the application with Capistrano

      11m26s
    • videocam
      Install SSL certificate

      11m26s
Rails basic
Ruby on Rails for Beginners


Note: This is a module belongs to the classes, billing features separate for this module will be allowed if the content matches. The classes using this module are listed below.

Introduction

Ruby on Rails, or Rails, is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web pages.

It encourages and facilitates the use of web standards such as JSON or XML for data transfer, and HTML, CSS and JavaScript for display and user interfacing. In addition to MVC, Rails emphasizes the use of other well-known software engineering patterns and paradigms, including convention over configuration (CoC), don't repeat yourself (DRY), and the active record pattern.

David Heinemeier Hansson extracted Ruby on Rails from his work on the project management tool Basecamp at the web application company also called Basecamp. Hansson first released Rails as open source in July 2004, but did not share commit rights to the project until February 2005.

In August 2006, the framework reached a milestone when Apple announced that it would ship Ruby on Rails with Mac OS X v10.5 "Leopard", which was released in October 2007.

Technical

Like many web frameworks, Ruby on Rails uses the model–view–controller (MVC) pattern to organize application programming. In a default configuration, a model in the Ruby on Rails framework maps to a table in a database and to a Ruby file.

For example, a model class User will usually be defined in the file 'user.rb' in the app/models directory, and linked to the table 'users' in the database. While developers are free to ignore this convention and choose differing names for their models, files, and database table, this is not common practice and is usually discouraged in accordance with the "convention-over-configuration" philosophy.

A controller is a server-side component of Rails that responds to external requests from the web server to the application, by determining which view file to render. The controller may also have to query one or more models for information and pass these on to the view.

For example, in an airline reservation system, a controller implementing a flight-search function would need to query a model representing individual flights to find flights matching the search, and might also need to query models representing airports and airlines to find related secondary data.

The controller might then pass some subset of the flight data to the corresponding view, which would contain a mixture of static HTML and logic that use the flight data to create an HTML document containing a table with one row per flight.

A controller may provide one or more actions. In Ruby on Rails, an action is typically a basic unit that describes how to respond to a specific external web-browser request. Also, note that the controller/action will be accessible for external web requests only if a corresponding route is mapped to it.

Rails encourages developers to use RESTful routes, which include actions such as create, new, edit, update, destroy, show, and index. These mappings of incoming requests/routes to controller actions can be easily set up in the routes.rb configuration file.

A view in the default configuration of Rails is an erb file, which is evaluated and converted to HTML at run-time. Alternatively, many other templating systems can be used for views.
Ruby on Rails includes tools that make common development tasks easier "out-of-the-box", such as scaffolding that can automatically construct some of the models and views needed for a basic website.

Also included are WEBrick, a simple Ruby web server that is distributed with Ruby, and Rake, a build system, distributed as a gem. Together with Ruby on Rails, these tools provide a basic development environment.

Philosophy

Ruby on Rails is intended to emphasize Convention over Configuration (CoC), and the Don't Repeat Yourself (DRY) principle.

"Convention over Configuration" means a developer only needs to specify unconventional aspects of the application. For example, if there is a class Sales in the model, the corresponding table in the database is called sales by default.

It is only if one deviates from this convention, such as calling the table "products sold", that the developer needs to write code regarding these names. Generally, Ruby on Rails conventions lead to less code and less repetition.

"Don't repeat yourself" means that information is located in a single, unambiguous place. For example, using the ActiveRecord module of Rails, the developer does not need to specify database column names in class definitions.

Instead, Ruby on Rails can retrieve this information from the database based on the class name. "Fat models, skinny controllers" means that most of the application logic should be placed within the model while leaving the controller as light as possible.

Table of Content

1. Introduction

  • Introduction to Ruby on Rails
  • Install Ruby on Rails on Ubuntu
  • Install Ruby on Rails on MacOS
  • Install Ruby on Rails on Docker
  • Setup the IDE and GIT

2. Ruby on Rails Basic

  • The basic principles of MVC
  • Create the Blog app
  • Creating the Article Model
  • Running a Migration
  • Adding Some Validation
  • Creating the Article Controller
  • Creating the view pages for Article
  • Creating the Category model
  • Associating Article and Category
  • Configure routes
  • Running Rails Console
  • Adding Avatar Image for Article
  • Install Material Design

3. Rails Model

  • Active Record Basics
  • Convention over Configuration in Active Record
  • Creating Active Record Models
  • Overriding the Naming Conventions
  • CRUD: Reading and Writing Data
  • Rollback/Reset Migration
  • Schema Dumping
  • Validations Model
  • Callbacks in Model
  • Active Record Associations
  • Active Record Query Interface

4. Rails Views

  • Rendering by Default
  • Using render
  • Using redirect_to
  • Using head To Build Header-Only Responses
  • Asset Tag Helpers
  • Understanding yield
  • Using the content_for Method
  • Using Partials
  • Using Nested Layouts

5. Rails Controllers

  • Controller Naming Convention
  • Methods and Actions
  • Parameters in Controller
  • Session and Cookies
  • Rendering XML and JSON data
  • Filters in Controller
  • Request Forgery Protection
  • The Request and Response Objects
  • HTTP Authentications
  • Streaming and File Downloads
  • Log Filtering
  • Rescue
  • Force HTTPS protocol

6. Rails Router

  • Resource Routing
  • Non-Resourceful Routes
  • Customizing Resourceful Routes
  • Inspecting and Testing Routes

7. Action Mailer

  • Generating a Mailer
  • Auto encoding header values
  • Complete List of Action Mailer Methods
  • Mailer Views
  • Action Mailer Layouts
  • Previewing Emails
  • Generating URLs in Action Mailer Views
  • Adding images in Action Mailer Views
  • Sending Multipart Emails
  • Sending Emails with Dynamic Delivery Options
  • Sending Emails without Template Rendering
  • Sending Emails with Gmail SMTP
  • Sending Emails with Amazon SES
  • Receiving Emails
  • Action Mailer Callbacks
  • Using Action Mailer Helpers
  • Mailer Testing
  • Intercepting Emails

8. Active Job

  • Creating a Job
  • Job Execution
  • Queues in Job
  • Callbacks in Job
  • Internationalization
  • GlobalID
  • Exceptions
  • Job Testing
  • Using Sidekiq
  • Using Whenever

9. Testing and Debug in Rails

  • Introduction to Testing
  • The Test Environment
  • Rails meets Minitest
  • Rails Specific Assertions
  • The Test Database
  • Model Testing
  • System Testing
  • Integration Testing
  • Functional Tests
  • Testing Routes
  • Testing Views
  • Testing Helpers
  • Testing Your Mailers
  • Testing Jobs
  • Testing Resources
  • Using RSpec
  • Using Capybara
  • View Helpers for Debugging
  • The Logger
  • Debugging with the byebug gem
  • Debugging with the web-console gem
  • Debugging Memory Leaks

10. Action Cable

  • Introduction to Action Cable
  • Introduction to Publish/Subscribe
  • Server-Side Components
  • Client-Side Components
  • Client-Server Interactions
  • Example 1: User Appearances
  • Example 2: Receiving New Web Notifications
  • Configuration Subscription
  • Running Standalone Cable Servers
  • Build the chat realtime app

11. Rails for API-only Applications

  • What is an API Application?
  • Why Use Rails for JSON APIs?
  • The Basic Configuration
  • Choosing Middleware
  • Choosing Controller Modules

12. Ruby on Rails Security

  • Session ID
  • Session Hijacking
  • Session Guidelines
  • Session Storage
  • Replay Attacks for CookieStore Sessions
  • Session Fixation
  • Session Fixation - Countermeasures
  • Session Expiry
  • Cross-Site Request Forgery (CSRF)
  • Redirection and Files Security
  • User Management Security
  • Injection
  • Unsafe Query Generation
  • Environmental Security

13. Internationalization

  • How I18n in Ruby on Rails Works
  • Setup Internationalization
  • Internationalization and Localization
  • Overview of the I18n API Features
  • Custom Translations
  • Customize your I18n Setup

14. Deploy Application

  • Install a Linux Server
  • Deploy the application manually
  • Deploy the application with Capistrano
  • Install SSL certificate