Slide 1

Slide 1 text

第一讲: Start Here xds2000 欢迎来 ruby-china.org 参与讨论 ruby 话题 http://xiaods.github.com/rails-starter-for-china/

Slide 2

Slide 2 text

新手的痛苦 ● 基本的编程概念不懂? ● Ruby 语言有专门看过吗? ● HTML, CSS, Javascript 要懂到啥程度?我会复制别 人的网页算吗?! ● 数据库我用过 MS SQL 可以吗? ● Web 是什么,不就是网页吗?我懂!? ● Git ,版本控制工具,我没用过

Slide 3

Slide 3 text

我们的约定 ● Ruby 语言需要你课下练习,推荐 Rubymonk, 'I am having fun learning Ruby at http://rubymonk.com I like this type of lessens ;-)' quote from Yukihiro Matsumoto ● Rails 版本持续保持在最新稳定版 ● RubyGems 网站要了解,越多越好 ● SQLite3 数据库要了解,越多越好 ● No Windows, Only Linux, Fedora prefer!

Slide 4

Slide 4 text

Rails 开发 Web 框架介绍 -Cont. ● Rails philosophy ● DRY – “Don’t Repeat Yourself” ● Convention Over Configuration ● REST is the best pattern for web applications

Slide 5

Slide 5 text

Rails 开发 Web 框架介绍 -cont. ● The MVC Architecture ● Isolation of business logic from the user interface ● Ease of keeping code DRY ● Making it clear where different types of code belong for easier maintenance

Slide 6

Slide 6 text

Rails 开发 Web 框架介绍 -cont. ● The Components of Rails ● Action Pack Action Controller Action Dispatch Action View ● Action Mailer ● Active Model ● Active Record ● Active Resource ● Active Support ● Railties

Slide 7

Slide 7 text

Rails 开发 Web 框架介绍 ● REST ● Using resource identifiers such as URLs to represent resources. ● Transferring representations of the state of that resource between system components.

Slide 8

Slide 8 text

创建我的第一个 Rails 项目 -Cont. ● gem install rails ● rails --version 1. rails new blog 2. rails db:create 3. rails server 4. rails generate controller home index 5. rm public/index.html 6. Edit app/views/home/index.html.erb, edit it to contain a single line of code:

Hello, Rails!

7.Open the file config/routes.rb in your editor. Add this line of code: root :to => "home#index" 8.navigate to http://localhost:3000 in your browser, you’ll see Hello, Rails!.

Slide 9

Slide 9 text

创建我的第一个 Rails 项目 成功!来,干一杯!

Slide 10

Slide 10 text

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.