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 Bootcamp [Sesión 03]
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
A. Felipe Cabargas Madrid
June 04, 2016
Programming
67
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rails Bootcamp [Sesión 03]
A. Felipe Cabargas Madrid
June 04, 2016
More Decks by A. Felipe Cabargas Madrid
See All by A. Felipe Cabargas Madrid
Layers Layers Layers
felipecabargas
0
63
Accesibilidad Web: Que, como, cuando y por que?
felipecabargas
0
38
Untangling git
felipecabargas
0
65
Docker 101
felipecabargas
1
92
GroupRaise Learning Fridays: UX 101
felipecabargas
0
110
GroupRaise Learning Fridays: Hows and whys of version control
felipecabargas
0
57
Sesion III - Taller RoR LCC
felipecabargas
0
98
Sesion II - Taller RoR LCC
felipecabargas
0
130
Taller RoR LCC
felipecabargas
0
150
Other Decks in Programming
See All in Programming
Webフレームワークの ベンチマークについて
yusukebe
0
180
ふつうのFeature Flag実践入門
irof
8
4.1k
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
390
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
170
スマートグラスで並列バイブコーディング
hyshu
0
260
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
360
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
270
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
170
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
910
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
910
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
11
6.1k
Featured
See All Featured
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
210
Designing for Timeless Needs
cassininazir
1
260
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
610
How to Ace a Technical Interview
jacobian
281
24k
Docker and Python
trallard
47
3.9k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
330
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
300
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
600
Ruling the World: When Life Gets Gamed
codingconduct
0
260
The browser strikes back
jonoalderson
0
1.3k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Transcript
RAILS BOOTCAMP 3 JUNIO 2016
ACTIVERECORD
Modelos
$ rails generate model Person
/app/models/person.rb
Migraciones
/db/migrate
$ rake db:migrate
Crear modelo de datos de tu app recuerden migrar los
nuevos modelos
Jugando con la consola de rails recuerden migrar los nuevos
modelos
$ rails console
p = Person.first
p.name
Person.all
Crear asociaciones
$ rails generate migration AddReferencesToBook person:references
app/models/person.rb class Person < ActiveRecord::Base has_many :books # has_one :book
end
app/models/book.rb class Book < ActiveRecord::Base belongs_to :person end
Crear validaciones
app/models/person.rb class Person < ActiveRecord::Base validates :name, presence: true end
Callbacks
before_save after_save before_create after_create before_validation after_validation
app/models/person.rb class Person < ActiveRecord::Base before_save :count_pets def count_pets if
self.email.nil? puts "No tiene mail" else puts "Yeih! #{self.email}" end end end