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
230
[Rails 开发入门课程] 第三节 ActiveRecord Association
daqing
2
260
[Rails 开发入门课程] 第二节 Model
daqing
4
510
[Rails 开发入门课程] 第一节 Rails 运行环境
daqing
7
450
Other Decks in Programming
See All in Programming
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
1k
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
dRuby over BLE
makicamel
2
410
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
430
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
140
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
240
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
320
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
140
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
120
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
230
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.8k
ランチタイムLT会3周年!ランチタイムLT会を3年間続けられたお話
y0hgi
1
130
Featured
See All Featured
Designing Experiences People Love
moore
143
24k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
320
Six Lessons from altMBA
skipperchong
29
4.3k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
180
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Abbi's Birthday
coloredviolet
3
8.5k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
380
Bash Introduction
62gerente
615
220k
Agile that works and the tools we love
rasmusluckow
331
22k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
190
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
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⽇日星期⼆二