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
860
[Rails 开发入门课程] 第四节 Routes
daqing
0
200
[Rails 开发入门课程] 第三节 ActiveRecord Association
daqing
2
240
[Rails 开发入门课程] 第二节 Model
daqing
4
470
[Rails 开发入门课程] 第一节 Rails 运行环境
daqing
7
430
Other Decks in Programming
See All in Programming
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
1
300
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
150
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
800
F#で自在につくる静的ブログサイト - 関数型まつり2025
pizzacat83
0
310
Beyond Portability: Live Migration for Evolving WebAssembly Workloads
chikuwait
0
390
WindowInsetsだってテストしたい
ryunen344
1
190
Cursor AI Agentと伴走する アプリケーションの高速リプレイス
daisuketakeda
1
130
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
110
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
190
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
150
Gleamという選択肢
comamoca
6
760
5つのアンチパターンから学ぶLT設計
narihara
1
110
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
337
57k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
700
How to Ace a Technical Interview
jacobian
277
23k
VelocityConf: Rendering Performance Case Studies
addyosmani
330
24k
What's in a price? How to price your products and services
michaelherold
246
12k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
How STYLIGHT went responsive
nonsquared
100
5.6k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
53k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
Gamification - CAS2011
davidbonilla
81
5.3k
A designer walks into a library…
pauljervisheath
206
24k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
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⽇日星期⼆二