Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Rails Bootcamp [Sesión 03]
Search
A. Felipe Cabargas Madrid
June 04, 2016
Programming
70
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
76
Accesibilidad Web: Que, como, cuando y por que?
felipecabargas
0
50
Untangling git
felipecabargas
0
73
Docker 101
felipecabargas
1
96
GroupRaise Learning Fridays: UX 101
felipecabargas
0
110
GroupRaise Learning Fridays: Hows and whys of version control
felipecabargas
0
61
Sesion III - Taller RoR LCC
felipecabargas
0
100
Sesion II - Taller RoR LCC
felipecabargas
0
140
Taller RoR LCC
felipecabargas
0
160
Other Decks in Programming
See All in Programming
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
180
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
310
iOSDC2026登壇資料.pdf
riofujimon
0
180
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
500
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
280
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
920
AI活用は、個人から組織へ|マルチプレイヤーエージェントハーネス「QM」の社内活用事例 / AI use is moving from individuals to orgs
rkaga
1
180
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
540
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
4
12k
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1.1k
wkhtmltopdfの次どうするか問題2026
willnet
2
1.6k
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
0
1.8k
Featured
See All Featured
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
510
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
530
How to make the Groovebox
asonas
2
2.4k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Prompt Engineering for Job Search
mfonobong
0
460
Mind Mapping
helmedeiros
1
370
First, design no harm
axbom
PRO
2
1.3k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
710
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
480
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