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
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
410
Developers Summit 2020 - 13-A-5
kyanagimoto
0
2.2k
Nikotama.rb #9
kyanagimoto
0
320
Nikotama.rb #8
kyanagimoto
0
210
CNCF for Rubyist
kyanagimoto
0
440
Nikotama.rb #7
kyanagimoto
0
450
Rails Application w/ Kubernetes
kyanagimoto
1
430
Other Decks in Technology
See All in Technology
生成 AI 実践ガイド (概略版) AIガバナンス編
asei
0
170
“詰む”前に仕組みを作れ 〜技術の波に溺れないためのキャッチアップ術〜
takasyou
7
3.5k
Flow 不死:AI 時代 DevOps 的不變本質
cheng_wei_chen
2
480
AIが自律的に回る開発ループを設計してチーム開発に組み込む
nekorush14
0
110
FPC(フレキシブル)基板にZephyr実装してみた。
iotengineer22
0
160
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
2k
WebGIS AI Agentの紹介
_shimizu
0
520
いまさら聞けない「仕様駆動開発入門」 〜AI活用時代の開発プロセスを考える〜
findy_eventslides
2
180
GitHub Copilot 最新アップデート – 「一歩先」の実践活用術
moulongzhang
5
1.6k
ぼっちではじめた登壇が「51名」「241件」の発信に化けた
subroh0508
1
300
AIチャット検索改善の3週間
kworkdev
PRO
2
160
AIのReact習熟度を測る
uhyo
2
670
Featured
See All Featured
Speed Design
sergeychernyshev
33
1.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
It's Worth the Effort
3n
188
29k
Statistics for Hackers
jakevdp
799
230k
Bash Introduction
62gerente
615
220k
Designing Experiences People Love
moore
143
24k
Being A Developer After 40
akosma
91
590k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
390
Heart Work Chapter 1 - Part 1
lfama
PRO
7
36k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
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/