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
A. Felipe Cabargas Madrid
June 04, 2016
Programming
0
55
Rails Bootcamp [Sesión 03]
A. Felipe Cabargas Madrid
June 04, 2016
Tweet
Share
More Decks by A. Felipe Cabargas Madrid
See All by A. Felipe Cabargas Madrid
Layers Layers Layers
felipecabargas
0
55
Accesibilidad Web: Que, como, cuando y por que?
felipecabargas
0
25
Untangling git
felipecabargas
0
59
Docker 101
felipecabargas
1
79
GroupRaise Learning Fridays: UX 101
felipecabargas
0
95
GroupRaise Learning Fridays: Hows and whys of version control
felipecabargas
0
48
Sesion III - Taller RoR LCC
felipecabargas
0
80
Sesion II - Taller RoR LCC
felipecabargas
0
120
Taller RoR LCC
felipecabargas
0
130
Other Decks in Programming
See All in Programming
Go言語の特性を活かした公式MCP SDKの設計
hond0413
2
500
Claude CodeによるAI駆動開発の実践 〜そこから見えてきたこれからのプログラミング〜
iriikeita
0
330
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
230
Google Opalで使える37のライブラリ
mickey_kubo
3
140
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
280
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
2
800
CSC305 Lecture 10
javiergs
PRO
0
230
Migration to Signals, Resource API, and NgRx Signal Store
manfredsteyer
PRO
0
110
タスクの特性や不確実性に応じた最適な作業スタイルの選択(ペアプロ・モブプロ・ソロプロ)と実践 / Optimal Work Style Selection: Pair, Mob, or Solo Programming.
honyanya
3
190
実践Claude Code:20の失敗から学ぶAIペアプログラミング
takedatakashi
18
8.5k
オープンソースソフトウェアへの解像度🔬
utam0k
17
3.1k
Claude Agent SDK を使ってみよう
hyshu
0
1.4k
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
4.9k
Context Engineering - Making Every Token Count
addyosmani
8
300
We Have a Design System, Now What?
morganepeng
53
7.8k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Building Adaptive Systems
keathley
44
2.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
610
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.9k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
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