培訓目標:
Download and install Rails along with various other products that allow one to write Rails applications
Understand the Model, View, Controller paradigm and how this applies to Rails applications
Understand the directory structure of a Rails application
Build non-trivial database backed Web Applications
Understand the ActiveRecord classes and how they wrap database tables
Understand the interplay between various controller actions and .rhtml (template) files
Understand the Create, Read, Update, and Destroy (CRUD) paradigm
Validate Model data
Test Rails applications
Use the Rails console to debug applications
■ 課程內容:
Chapter 1: An Overview Of Ruby on Rails
What is Ruby on Rails?
Downloading Rails
A Rails Application
Structure of a Rails Application
Building the Controller
Views
A Quick Review
Rails Conventions
Embedded Ruby
Extended Time Functions
The render Method
The link_to Method
One Last Thought
Chapter 2: Fill in Forms
Introduction
Creating a Form
Submitting a Form
Other Form Elements - Checkboxes
Radio Buttons
Rails Helper Methods
Loading the Form
Submitting the Form
Perspective
Chapter 3: Databases and Rails
Review of MVC
Entities and Relationships
Databases and Models
database.yml
Adding the Model
Migrations
The Index Page
The Ruby Console
Listing the Rows of a Database Table
Scaffolding
Chapter 4: Validation Techniques
Introduction
form_for
Data Validation
Required Fields
Validating Numerical Fields
Validating Uniqueness
Validating Lengths
|