Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
[Rails 开发入门课程] 第五节 Controllers & Views
Search
David Zhang
January 29, 2013
Programming
0
110
[Rails 开发入门课程] 第五节 Controllers & Views
这一节主要讲解 Controller 和 View 的用法,不过以线下演示为主。
David Zhang
January 29, 2013
Tweet
Share
More Decks by David Zhang
See All by David Zhang
Implement Heap Sort in Erlang
daqing
0
870
[Rails 开发入门课程] 第四节 Routes
daqing
0
200
[Rails 开发入门课程] 第三节 ActiveRecord Association
daqing
2
240
[Rails 开发入门课程] 第二节 Model
daqing
4
480
[Rails 开发入门课程] 第一节 Rails 运行环境
daqing
7
430
Other Decks in Programming
See All in Programming
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
240
Navigating Dependency Injection with Metro
zacsweers
3
260
AI時代のUIはどこへ行く?
yusukebe
18
8.8k
AWS発のAIエディタKiroを使ってみた
iriikeita
1
180
Oracle Database Technology Night 92 Database Connection control FAN-AC
oracle4engineer
PRO
1
440
そのAPI、誰のため? Androidライブラリ設計における利用者目線の実践テクニック
mkeeda
2
290
print("Hello, World")
eddie
2
530
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
1.3k
アルテニア コンサル/ITエンジニア向け 採用ピッチ資料
altenir
0
100
🔨 小さなビルドシステムを作る
momeemt
4
680
ソフトウェアテスト徹底指南書の紹介
goyoki
1
150
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
530
Featured
See All Featured
Docker and Python
trallard
45
3.6k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
How to train your dragon (web standard)
notwaldorf
96
6.2k
RailsConf 2023
tenderlove
30
1.2k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
The World Runs on Bad Software
bkeepers
PRO
70
11k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Designing for Performance
lara
610
69k
Transcript
课前准备 https://github.com/daqing/rails-intro-forum/wiki/Preparing-for-the-course 13年2月5⽇日星期⼆二
RAILS 开发⼊入⻔门课程 Introduction to Web development with Rails @daqing 13年2月5⽇日星期⼆二
⺫⽬目标 理解 Rails 中的核⼼心概念 了解 Rails 项⺫⽬目的基本开发过程 可以开发简单的 Rails 应⽤用
13年2月5⽇日星期⼆二
RAILS 开发⼊入⻔门课程 RAILS 运⾏行环境 Model Routes 第⼀一节 第⼆二节 第五节 Controllers
& Views ActiveRecord Association 第六节 Form API 第三节 第四节 13年2月5⽇日星期⼆二
内容回顾 浏览器 Web Server App Server DB Rails API HTTP
请求处理流程 13年2月5⽇日星期⼆二
RAILS APP 核⼼心结构 DB request Model View Controller ActionPack Routes
13年2月5⽇日星期⼆二
RAILS APP 核⼼心结构 DB request Model View Controller ActionPack Routes
13年2月5⽇日星期⼆二
RAILS APP 核⼼心结构 DB request Model View Controller ActionPack Routes
13年2月5⽇日星期⼆二
RAILS APP 核⼼心结构 DB request Model View Controller ActionPack Routes
13年2月5⽇日星期⼆二
CONTROLLERS 13年2月5⽇日星期⼆二
Model View Controller 输⼊入 CONTROLLER 职责 输出 13年2月5⽇日星期⼆二
输⼊入 params request 13年2月5⽇日星期⼆二
输⼊入 http://www.example.com/topics/new?node=9 {“node” => “ ”, “controller” => “topics”, “action”
=> “new”} => params request => <ActionDispatch::Request> >> request.domain >> request.subdomain example.com www 13年2月5⽇日星期⼆二
DEMO 13年2月5⽇日星期⼆二
VIEWS 13年2月5⽇日星期⼆二
VIEWS layout = yield = yield :head view - content_for
:head do end ......... #topics = render @topics partial .topic h = @topic.subject helper def ......... short_title (title) end 13年2月5⽇日星期⼆二
DEMO 13年2月5⽇日星期⼆二
RAILS APP 核⼼心结构 DB request Model View Controller ActionPack Routes
13年2月5⽇日星期⼆二
推荐阅读 Action Controller Overview http://guides.rubyonrails.org/action_controller_overview.html http://guides.rubyonrails.org/layouts_and_rendering.html Layouts and Rendering in
Rails 13年2月5⽇日星期⼆二
QUESTIONS ? 13年2月5⽇日星期⼆二
谢谢 RAILS 开发⼊入⻔门课程 第五节 CONTROLLERS & VIEWS(完) http://rabelapp.com https://github.com/daqing http://ruby-china.org/daqing
13年2月5⽇日星期⼆二