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
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
[Rails 开发入门课程] 第五节 Controllers & Views
这一节主要讲解 Controller 和 View 的用法,不过以线下演示为主。
David Zhang
January 29, 2013
More Decks by David Zhang
See All by David Zhang
Implement Heap Sort in Erlang
daqing
0
900
[Rails 开发入门课程] 第四节 Routes
daqing
0
240
[Rails 开发入门课程] 第三节 ActiveRecord Association
daqing
2
260
[Rails 开发入门课程] 第二节 Model
daqing
4
510
[Rails 开发入门课程] 第一节 Rails 运行环境
daqing
7
460
Other Decks in Programming
See All in Programming
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
200
Android CLI
fornewid
0
200
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
200
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
570
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
190
Claude Team Plan導入・ガイド
tk3fftk
0
250
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
110
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
200
AI時代のPHPer生存戦略 ~「言語、もうなんでもよくない?」に本気で向き合う~
vivion
0
220
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
380
今さら聞けない .NET CLI
htkym
0
170
yield再入門 #phpcon
o0h
PRO
0
860
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
22k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
470
[SF Ruby Conf 2025] Rails X
palkan
2
1.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.4k
How to make the Groovebox
asonas
2
2.3k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
440
What's in a price? How to price your products and services
michaelherold
247
13k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
420
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⽇日星期⼆二