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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
David Zhang
January 29, 2013
Programming
120
0
Share
[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
890
[Rails 开发入门课程] 第四节 Routes
daqing
0
220
[Rails 开发入门课程] 第三节 ActiveRecord Association
daqing
2
260
[Rails 开发入门课程] 第二节 Model
daqing
4
500
[Rails 开发入门课程] 第一节 Rails 运行环境
daqing
7
450
Other Decks in Programming
See All in Programming
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
140
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
690
Agentic UI beyond Chats Architecture Patterns & Open Standards @ngMunich 05/2026
manfredsteyer
PRO
0
130
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
300
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
120
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
1
760
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
1.1k
PHPでローカル環境用のSSL/TLS証明書を発行することはできるのか? #phpconkagawa
akase244
0
380
空間オーディオの活用
objectiveaudio
0
160
My daily life on Ruby
a_matsuda
3
430
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
240
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
120
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
400
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
530
We Have a Design System, Now What?
morganepeng
55
8.1k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Building AI with AI
inesmontani
PRO
1
1k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
410
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
810
Facilitating Awesome Meetings
lara
57
6.9k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
350
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
140
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⽇日星期⼆二