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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
470
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
190
CNCF for Rubyist
kyanagimoto
0
420
Nikotama.rb #7
kyanagimoto
0
430
Rails Application w/ Kubernetes
kyanagimoto
1
420
Other Decks in Technology
See All in Technology
NgRx SignalStore: The Power of Extensibility
rainerhahnekamp
0
200
Claude Teamプランの選定と、できること/できないこと
rfdnxbro
1
2.1k
数案件を同時に進行するためのコンテキスト整理術
sutetotanuki
1
200
ログ基盤・プラグイン・ダッシュボード、全部整えた。でも最後は人だった。
makikub
5
1.6k
2026年に相応しい 最先端プラグインホストの設計<del>と実装</del>
atsushieno
0
110
ストライクウィッチーズ2期6話のエイラの行動が許せないのでPjMの観点から何をすべきだったのかを考える
ichimichi
1
320
AI時代に新卒採用、はじめました/junior-engineer-never-die
dmnlk
0
240
AIを活用したアクセシビリティ改善フロー
degudegu2510
1
170
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」ご紹介資料
laysakura
0
1.6k
Zero-Downtime Migration: Moving a Massive, Historic iOS App from CocoaPods to SPM and Tuist without Stopping Feature Delivery
kagemiku
0
230
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
5
14k
BIツール「Omni」の紹介 @Snowflake中部UG
sagara
0
270
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
120
A better future with KSS
kneath
240
18k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How to Think Like a Performance Engineer
csswizardry
28
2.5k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
710
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
340
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
180
Faster Mobile Websites
deanohume
310
31k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
170
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/