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
850
[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
バイセルでの AI を用いた開発の取り組み ~ Devin, Cursor の活用事例・知見共有 ~
umaidashi
0
110
若手バックエンドエンジニアが Elasticsearch を使ってみた話
hott0mott0
1
100
Expoによるアプリ開発の現在地とReact Server Componentsが切り開く未来
yukukotani
2
290
LINE messaging APIを使ってGoogleカレンダーと連携した予約ツールを作ってみた
takumakoike
0
140
ABEMA iOS 大規模プロジェクトにおける段階的な技術刷新 / ABEMA iOS Technology Upgrade
akkyie
1
260
Amazon Bedrockマルチエージェントコラボレーションを諦めてLangGraphに入門してみた
akihisaikeda
1
180
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
250
15分で学ぶDuckDBの可愛い使い方 DuckDBの最近の更新
notrogue
3
870
AWS Step Functions は CDK で書こう!
konokenj
5
930
変化の激しい時代における、こだわりのないエンジニアの強さ
satoshi256kbyte
1
810
From the Wild into the Clouds - Laravel Meetup Talk
neverything
0
190
クリーンアーキテクチャから見る依存の向きの大切さ
shimabox
5
1.2k
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Adopting Sorbet at Scale
ufuk
75
9.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
270
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Facilitating Awesome Meetings
lara
53
6.3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Bash Introduction
62gerente
611
210k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
Become a Pro
speakerdeck
PRO
26
5.2k
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⽇日星期⼆二