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
Rails5について(仮)
Search
Masaki Ozawa
August 19, 2016
Programming
47
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rails5について(仮)
2016年8月19日 イドバタ会議 #2
Masaki Ozawa
August 19, 2016
Other Decks in Programming
See All in Programming
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
460
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
790
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
210
カツオ、ご期待ください
suneo3476
0
190
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
Featured
See All Featured
How to build a perfect <img>
jonoalderson
1
6.1k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Designing Experiences People Love
moore
143
24k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
330
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
550
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Tell your own story through comics
letsgokoyo
1
1.1k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Google's AI Overviews - The New Search
badams
0
1.6k
Transcript
Πυόλձٞ#2 / 20168݄19 Rails5ʹ͍ͭͯ(Ծ)
ࣗݾհ • খᖒণथʢ͓͟Θ·͖͞ʣ • גࣜձࣾγΦϥϘ • RubyRailsͷΤϯδχΞ • GitHub: ozamasa
• Twitter: @ozamasa
None
http://rubyonrails.org/
“Ruby on Rails (୯ʹʮRailsʯͱݺͿ͜ͱ͋ Γ·͢) ɺRubyϓϩάϥϛϯάݴޠͰهड़ ͞ΕͨɺWeb։ൃϑϨʔϜϫʔΫͰ͢ɻ - Ruby on
Rails νϡʔτϦΞϧ
rails new • gem install rails • rails new hello_rails5
• cd hello_rails5 • rails s http://localhost:3000
scaffold • rails g scaffold Book name:string auther:string • rails
db:migrate http://localhost:3000/books
Railsͷྺ࢙ 2004-10-25 2007-12-07 2009-03-15 2010-08-29 2012-01-20 2013-06-25 2014-12-20 2016-06-30 0.8.0
2.0.1 2.3.2 3.0.0 3.2.0 4.0.0 4.2.0 5.0.0 RESTful SQlite3 Rack DRY CoC i18n Arel jQuery SCSS CoffeeScript Ruby2.0 Strong Parameters Turbolinks Active Job
None
Rails5Ͱͷ৽ػೳɾมߋ 1. Action Cable͕ؒೖΓ 2. APIϞʔυΛ౷߹ 3. railsίϚϯυҰຊԽ 4. ࡉ͔͍มߋ͍Ζ͍Ζ
1. Action Cable͕ؒೖΓ • WebsocketΛͬͨϦΞϧλΠϜʹํ௨৴Λ͓͜ͳ͏Ξϓ ϦέʔγϣϯΛ؆୯ʹ࡞ΕΔΑ͏ʹͳΓ·ͨ͠ɻνϟοταʔ ϏεΈ͍ͨͳͷΛ؆୯ʹ࡞Ε·͢ɻ • Websocketॲཧʹ͓͍ͯίϯτϩʔϥͷΑ͏ͳׂΛ͢Δɺ νϟωϧΛ࡞͢ΔδΣωϨʔλ͕Ճ͞Ε·ͨ͠ɻ
• rails g channel room speak
2. APIϞʔυΛ౷߹ • WebAPI༻ͷΞϓϦέʔγϣϯΛ؆୯ʹ࡞ΔͨΊͷΈ͕ಋ ೖ͞Ε·ͨ͠ɻ • RailsΞϓϦέʔγϣϯΛ࡞͢Δࡍʹʮ--apiʯΦϓγϣϯΛ ͚ͭ·͢ɻ • rails
new hello_rails5_api --api
3. railsίϚϯυҰຊԽ • bin/rake ίϚϯυ͕ bin/rails ίϚϯυͰ࣮ߦͰ͖ΔΑ͏ʹ ͳΓ·ͨ͠ɻ • rails
db:migrate # rake db:migrate • rails restart # touch tmp/restart.txt • rails test # rake test
4. ࡉ͔͍มߋ͍Ζ͍Ζ • Ruby 2.2.2Ҏ্͕ඞਢɻ • σϑΥϧτAPαʔόʔ͕WEBrick͔Βpumaʹɻ • Model ActiveRecord::Base
͔Β ApplicationRecord Λܧঝ͢ΔΑ͏ʹมߋɻ • ActiveRecord Attributes API͕Ճɻ • belongs_to ରԠ͢Δσʔλ͕ଘࡏ͢Δ͜ͱ͕ඞਢʹɻଘࡏ͠ͳ͍߹όϦσʔγϣϯΤ ϥʔʹͳΔͷͰɺճආ͢Δʹ optional: true ͕ඞཁɻ • View template ͕ͳ͍ͱ͖204͕ฦ͞ΕΔΑ͏ʹͳͬͨɻ • model.errors.details ͰΤϥʔλΠϓͱ option ͕औಘͰ͖ΔΑ͏ʹͳͬͨɻ • ActiveRecord::Relation#or • Numeric#positive?, negative? • Date#prev_day, next_day, next_weekday, prev_weekday, on_weekend? • Enumerable#pluck
Rails5Ͱͷ৽ػೳɾมߋ(͓͞Β͍) 1. Action Cable͕ؒೖΓ 2. APIϞʔυΛ౷߹ 3. railsίϚϯυҰຊԽ 4. ࡉ͔͍มߋ͍Ζ͍Ζ
Rails5ϚΠΫϩαʔϏεΛ ҙࣝ(Ծ)
ϚΠΫϩαʔϏε • ୯ҰͷΞϓϦέʔγϣϯΛখ͞ͳαʔϏε܈ͷΈ߹Θͤͱ͠ ͯߏங͠ɺαʔϏε૬ޓΛRESTful Web APIͷΑ͏ͳγϯϓϧ ͰܰྔͳػߏʹΑͬͯ࿈ܞ͢Δ͜ͱͰɺશମతͳϓϩμΫτΛ ఏڙ͠Α͏ͱ͢Δߟ͑ํɻ • খ͞ͳαʔϏεΛૄ݁߹͢ΔΑ͏ͳߏΛ࡞Δ͜ͱʹΑͬͯɺ
ϞϊϦγοΫͳγεςϜͷෳࡶ͔͞Βࣗ༝ʹͳΔ͜ͱ͕Ͱ͖ɺ มԽʹڧ͍γεςϜΛ࡞Δ͜ͱ͕Ͱ͖Δɻ • http://martinfowler.com/articles/microservices.html
ϚΠΫϩαʔϏε͕͞ΕΔഎܠ • Ϋϥυ • Ϛϧνςφϯτ • ܧଓతσϦόϦʔ • ܧଓతΠϯςάϨʔγϣϯ •
ϏδωεαΠΫϧͷ໋Խ • ҰํͰɺ ✦ ӡ༻ਂࠁ ✦ ΠϯλʔϑΣʔεͷ༷มߋʹΑΔӨڹ͕େ͖͍ ✦ ίϛϡχέʔγϣϯίετͷ૿େ ✦ ֶशίετͷ૿େ
“ ͨͱ͑300ਓ͍ͨͱͨ͠ΒɼզʑͰͦΕΛ๊͑ΔͷͰ ͳ͘ɼ30ݸ͘Β͍ձࣾΛ࡞ͬͯͦΕͧΕ͕ߦಈ͢Ε ͍͍Μ͡Όͳ͍͔ͳɻͦͯͦ͠͏͍͏Γํ͕͏·͍͘ ͘͜ͱΛੈʹ͏΄͏͕ɼੈͷதͷͨΊʹͳΔͷͰͳ ͍͔ͱࢥ͏ɻ -David Heinemeier Hansson