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
Rails6 New Functions
Search
k.yanagimoto
September 25, 2019
Technology
0
170
Rails6 New Functions
k.yanagimoto
September 25, 2019
Tweet
Share
More Decks by k.yanagimoto
See All by k.yanagimoto
cloudnative days tokyo online 2021 - 311
kyanagimoto
0
410
open telemetry w/ Ruby
kyanagimoto
0
320
nikotama.rb #10
kyanagimoto
0
400
Developers Summit 2020 - 13-A-5
kyanagimoto
0
2.1k
Nikotama.rb #9
kyanagimoto
0
300
Nikotama.rb #8
kyanagimoto
0
180
CNCF for Rubyist
kyanagimoto
0
410
Nikotama.rb #7
kyanagimoto
0
420
Rails Application w/ Kubernetes
kyanagimoto
1
400
Other Decks in Technology
See All in Technology
コンパウンド組織のCRE #cre_meetup
layerx
PRO
1
260
ヘンリー会社紹介資料(エンジニア向け) / company deck for engineer
henryofficial
0
360
Wasmの気になる最新情報
askua
0
190
クラウドとリアルの融合により、製造業はどう変わるのか?〜クラスメソッドの製造業への取組と共に〜
hamadakoji
0
420
Behind Postgres 18: The People, the Code, & the Invisible Work | Claire Giordano | PGConfEU 2025
clairegiordano
0
130
物体検出モデルでシイタケの収穫時期を自動判定してみた。 #devio2025
lamaglama39
0
280
Open Table Format (OTF) が必要になった背景とその機能 (2025.10.28)
simosako
1
140
AWS DMS で SQL Server を移行してみた/aws-dms-sql-server-migration
emiki
0
220
混合雲環境整合異質工作流程工具運行關鍵業務 Job 的經驗分享
yaosiang
0
180
AI-Readyを目指した非構造化データのメダリオンアーキテクチャ
r_miura
1
310
JSConf JPのwebsiteをGatsbyからNext.jsに移行した話 - Next.jsの多言語静的サイトと課題
leko
2
180
Linux カーネルが支えるコンテナの仕組み / LF Japan Community Days 2025 Osaka
tenforward
1
120
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
22k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Build your cross-platform service in a week with App Engine
jlugia
233
18k
Gamification - CAS2011
davidbonilla
81
5.5k
KATA
mclloyd
PRO
32
15k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.2k
Agile that works and the tools we love
rasmusluckow
331
21k
Embracing the Ebb and Flow
colly
88
4.9k
Raft: Consensus for Rubyists
vanstee
140
7.2k
GraphQLとの向き合い方2022年版
quramy
49
14k
Transcript
Rails 6 @kyanagimoto
ॕ Rails 6 release • Date: Aug 15th 2019 •
৽͍͠ίϯϙʔωϯτ Action Text / Action Mailbox • Webpackerͷ࠾༻ • ෳDBଓɺฒྻςετ࣮ߦ(TDD is dead͔ΒͷྲྀΕ) • > 2.5 https://railsguides.jp/6_0_release_notes.html
Action Text • WYSIWYG (ΟδΟά, What You See Is What
You Getͷུͩͬͯ) EditorͷTrixΛ ؆୯ʹ͑ΔΑɻ • ActiveStorageΛEditorͰೖྗͨ͠FileΛอ ଘ͢Δҝʹར༻͍ͯ͠Δɻ WYSIWYG EditorʹFileΛૠೖͨ࣌͠ ActiveStorageʹDirectUpload͞ΕΔ ༷ɻ
Action Mailbox • Mailͷड৴ॲཧͷͨΊͷίϯϙʔωϯτ * ActionMailer: MailΛRubyͰ͏ͨΊObjectʹม͢ΔͨΊ CloudͷϝʔϧॲཧอଘࣗલͰΔඞཁ͋ͬͨɻ • ActiveStorageʹMailΛอଘɺAction
Mailbox༻ͷDB Tableඞཁ
Webpacker • RailsͷJavaScript LibrarynpmͰެ։͞Ε͍ͯΔͷΛར༻ • CoffeeScript…ɻ(Action CableͰGenerate͞ΕΔίʔυ͕มԽ)
ෳDBଓ • config/database.yaml • app/models/hoge.rb • config/environments Sample: https://github.com/
effectiveDevOps/devops_meter/ blob/master/config/environments/ production.rb#L109
Parallelize test • github.com/rspec/rspec-rails/issues/2104 rspecͷରԠͲ͏·ͩΈ͍ͨͳײ͡ɻ
ͱΓ͋͑ͣɺ࡞ͬͯΈ·͠ΐ͏ $ gem i bundler $ gem i rails #
YarnΛར༻͢ΔͷͰɺInstallɹhttps://yarnpkg.com/en/docs/install $ brew install yarn $ brew install postgresql $ rails new sample -d postgresql
# DockerͰdatabaseཱͯΔ $ brew cask install docker $ docker run
--name dev-postgres -e POSTGRES_USER=nikotama -e POSTGRES_PASSWORD=postgres -p 15432:5432 -d postgres:11 # ֬ೝ $ docker container exec -it dev-postgres bash $$ psql -U nikotama $$ \l #database Ұཡ
$ vi config/database.yml ## developmentͷusername, password, host, portΛมߋɻ $ rake
db:create $ bundle exec rails action_text:install $ bundle exec rails action_mailbox:install $ bundle exec rails db:migrate
# Edit Gemfile $ vi Gemfile ## image_processingͷίϝϯτΞτΛ֎͢ $ bundle
install $ bundle exec rails generate scaffold post title:string body:rich_text $ bundle exec rake db:migrate
$ bundle exec rails s # Another pane $ bin/webpack-dev-server
# Access to http://localhost:3000/posts # WYSIWYG Editorग़ݱɻ
$ docker container exec -it dev-postgres bash $$ psql -U
nikotama $$$ \l $$$ \c sample_app_development $$$ \d $$$ select * from posts; $$$ select * from action_text_rich_texts; $$$ select * from active_storage_attachments; $$$ select * from active_storage_blobs; $ tree ./storage/