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 cn
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
blue planet
May 29, 2013
Programming
220
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
rails cn
Rails 简单介绍
blue planet
May 29, 2013
More Decks by blue planet
See All by blue planet
dapp 開発における big number の落とし穴 / Pitfalls of the big number in dapp development
blueplanet
0
130
join.me使用方法
blueplanet
0
130
Sublime Text 2 プラグイン開発 - ゼロからPackageControlへ登録まで
blueplanet
5
2.1k
Other Decks in Programming
See All in Programming
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
730
Webフレームワークの ベンチマークについて
yusukebe
0
130
AI駆動開発勉強会 広島支部 第一回勉強会 AI駆動開発概要とワークショップ
hayatoshimiu
0
450
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.2k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
150
AIエージェントの隔離技術の徹底比較
kawayu
0
460
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.2k
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.6k
The NotImplementedError Problem in Ruby
koic
1
610
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
210
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
120
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
13
3.5k
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
200
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
360
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
190
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
180
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
71
40k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
770
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
200
Transcript
Ruby on Rails
ఏ纲 • Ruby 语ݴ • Ruby on Rails ᐽՍ •
ԋࣔ • Notes
Ruby 语ݴ • ٭ຊ语ݴ • ໘对 • 动态㜎ܕ • 语๏优ඒ
Ruby on Rails ᐽՍ • MVC WEB 䇖发ᐽՍ • FullStack
Ruby 语ݴ
RubyੋҰ㛭ՄҎࣸग़ 优ඒ码ɼ让䇖发ऀ ײ౸շ乐త语ݴ DHH - ຊITProࡃ访
٭ຊ语ݴ • ෆधཁ编译 • Ruby൛ Hello, world • $ ruby
-e 'puts "Hello, world !"'
໘对 • Ҏ㜎为ج础త໘对 • ॴ༗త东ੋ对 • “aaa”.class • 1.class
动态㜎ܕ • 变ྔᏠध໌㜎ܕ • ਵ时ՄҎमվ㜎ɺ对తߦ为
变ྔᏠध໌㜎ܕ • name = “yu” • age = 25 •
user = User.new
ਵ时ՄҎमվ㜎ɼ对తߦ为 class User def say “name is yu” end end
user = User.new user.say -> “name is yu” class User def hello “hello” end end user = User.new user.hello -> “hello”
语๏优ඒ • 变ྔෆधཁ㜎ܕ໌ • ׅ߸߸ՄҎলུ • @䇖头త为实ྫ变ྔ • @@䇖头త为㜎变ྔ •
େࣸతੋৗྔ
语๏优ඒ
Ruby on Rails ᐽՍ
历࢙ • 2004/07 First version • 2005/12 1.0 • 2007/12
2.0 • 2010/08 3.0 • 2013/05 4.0(rc1)
MVC • Model • View • Controller
http://japanese.railstutorial.org/chapters/a-demo-app
ཧ೦ • 约ఆ优ဋ设ஔ Convention over Configuration • ෆཁॏ䐾㟬ࣗݾ Don’t Repeat
Yourself
约ఆ优ဋஔ • User (Model) • models/user.rb • users (table in
DB)
约ఆ优ဋஔ • UsersController (Controller) • controllers/users_controller.rb
约ఆ优ဋஔ • users#index (View) • views/users/index.html.erb
ෆཁॏ䐾㟬ࣗݾ • Ұද • create_users.sql / ख动创ݐʁ • class User
... • User.xml • update_ver211to212.sql
ෆཁॏ䐾㟬ࣗݾ • Ұද • create_users.rb • class User ...
ෆཁॏ䐾㟬ࣗݾ • user.java • user.rb
user.java
user.rb
ํศతޭೳ • ֤䝅ੜث • 环ڥཧ • ਾ库൛ຊཧ • ߇੍
֤䝅ੜث • rails generate • controller • model • migration
• rails destory
级实༻త环ڥཧ • ᘍ认ࡾ环ڥ • 䇖发ʗ测试ʗੜ产 • Մࣗఆ义 • ࠜਾ环ڥෆಉ设ஔෆಉࢀ •
ൺɿ发ૹ邮݅༻త务ثᅿ
ํศతਾ库൛ຊཧ • rake db: • migrate / test:prepare • rollback
• reset • drop
߇੍ • rails console • Մҙ执ߦ码 • 查ਾ
ԋࣔ
༰ • ৽ݐrails项 • ༻rails g scaffold notes body •
⃧Ճ㜎