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
880
[Rails 开发入门课程] 第四节 Routes
daqing
0
210
[Rails 开发入门课程] 第三节 ActiveRecord Association
daqing
2
250
[Rails 开发入门课程] 第二节 Model
daqing
4
490
[Rails 开发入门课程] 第一节 Rails 运行环境
daqing
7
440
Other Decks in Programming
See All in Programming
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
310
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
380
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
450
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
200
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
170
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
490
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
160
SourceGeneratorのマーカー属性問題について
htkym
0
170
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.6k
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
370
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
590
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
160
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
2
820
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
The Curious Case for Waylosing
cassininazir
0
260
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
850
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
460
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
370
Raft: Consensus for Rubyists
vanstee
141
7.3k
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⽇日星期⼆二