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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
k.yanagimoto
September 25, 2019
Technology
190
0
Share
Rails6 New Functions
k.yanagimoto
September 25, 2019
More Decks by k.yanagimoto
See All by k.yanagimoto
cloudnative days tokyo online 2021 - 311
kyanagimoto
0
480
open telemetry w/ Ruby
kyanagimoto
0
350
nikotama.rb #10
kyanagimoto
0
400
Developers Summit 2020 - 13-A-5
kyanagimoto
0
2.2k
Nikotama.rb #9
kyanagimoto
0
310
Nikotama.rb #8
kyanagimoto
0
200
CNCF for Rubyist
kyanagimoto
0
430
Nikotama.rb #7
kyanagimoto
0
440
Rails Application w/ Kubernetes
kyanagimoto
1
420
Other Decks in Technology
See All in Technology
地元にいないローカルオーガナイザーの立ち回り
uvb_76
1
410
Ruby::Boxでできること、Refinementsでできること
joker1007
2
230
運用を見据えたAIエージェント設計実践
amacbee
0
600
探して_入れて_作って_使う_Agent_Skills___LT.pdf
peintangos
2
130
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.8k
Datadog 認定試験の概要と対策
uechishingo
0
210
GoとSIMDとWasmの今。
askua
2
420
オンコールの負荷軽減のためのBits Assistant 活用方法 / How to Use Bits Assistant to Reduce the Workload on On-Call Staff
sms_tech
1
360
「嘘をつくテスト」の失敗例から学ぶ 良いテストコード #frontend_phpcon_do
asumikam
0
110
チームで実践する AI-DLC 思考の軌跡を残すチェックポイント設計
belongadmin
0
380
AIが変えた"品質の守り方"
kkakizaki
13
5.5k
Platform engineering for developers, architects & the rest of us (AI agents)
danielbryantuk
0
160
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.9k
Building Applications with DynamoDB
mza
96
7.1k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
370
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
The Curious Case for Waylosing
cassininazir
1
370
For a Future-Friendly Web
brad_frost
183
10k
Skip the Path - Find Your Career Trail
mkilby
1
130
Ethics towards AI in product and experience design
skipperchong
2
290
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
840
Practical Orchestrator
shlominoach
191
11k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Designing for Timeless Needs
cassininazir
1
240
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/