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
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
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
200
Claude Code、ちょっとした工夫で開発体験が変わる
tigertora7571
0
200
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
380
開発ステップを細分化する、破綻しないAI開発体制
kspace
0
110
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
610
Ruby x Terminal
a_matsuda
7
590
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
310
Unity6.3 AudioUpdate
cova8bitdots
0
110
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
200
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
360
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
390
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.8k
Featured
See All Featured
KATA
mclloyd
PRO
35
15k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Unsuck your backbone
ammeep
672
58k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
What does AI have to do with Human Rights?
axbom
PRO
1
2k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
96
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Side Projects
sachag
455
43k
WCS-LA-2024
lcolladotor
0
470
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
130
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⽇日星期⼆二