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
130
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
360
open telemetry w/ Ruby
kyanagimoto
0
270
nikotama.rb #10
kyanagimoto
0
370
Developers Summit 2020 - 13-A-5
kyanagimoto
0
2k
Nikotama.rb #9
kyanagimoto
0
270
Nikotama.rb #8
kyanagimoto
0
160
CNCF for Rubyist
kyanagimoto
0
370
Nikotama.rb #7
kyanagimoto
0
380
Rails Application w/ Kubernetes
kyanagimoto
1
360
Other Decks in Technology
See All in Technology
comilioとCloudflare、そして未来へと向けて
oliver_diary
6
440
2025年のARグラスの潮流
kotauchisunsun
0
790
20250116_JAWS_Osaka
takuyay0ne
2
200
WantedlyでのKotlin Multiplatformの導入と課題 / Kotlin Multiplatform Implementation and Challenges at Wantedly
kubode
0
240
Kotlin Multiplatformのポテンシャル
recruitengineers
PRO
2
150
あなたの人生も変わるかも?AWS認定2つで始まったウソみたいな話
iwamot
3
850
AWSの生成AIサービス Amazon Bedrock入門!(2025年1月版)
minorun365
PRO
7
470
embedパッケージを深掘りする / Deep Dive into embed Package in Go
task4233
1
210
ゼロからわかる!!AWSの構成図を書いてみようワークショップ 問題&解答解説 #デッカイギ #羽田デッカイギおつ
_mossann_t
0
1.5k
iPadOS18でフローティングタブバーを解除してみた
sansantech
PRO
1
130
【JAWS-UG大阪 reInvent reCap LT大会 サンバが始まったら強制終了】“1分”で初めてのソロ参戦reInventを数字で振り返りながら反省する
ttelltte
0
140
信頼されるためにやったこと、 やらなかったこと。/What we did to be trusted, What we did not do.
bitkey
PRO
0
2.2k
Featured
See All Featured
Writing Fast Ruby
sferik
628
61k
Scaling GitHub
holman
459
140k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
Done Done
chrislema
182
16k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Unsuck your backbone
ammeep
669
57k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
How to train your dragon (web standard)
notwaldorf
89
5.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
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/