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
Why Rails 5.1
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kyuden Masahiro
June 28, 2017
Programming
790
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Why Rails 5.1
MedBeer -Rails 5.1での開発について
https://medpeer.connpass.com/event/58805/
Kyuden Masahiro
June 28, 2017
More Decks by Kyuden Masahiro
See All by Kyuden Masahiro
Red-Black Tree for Ruby
kyuden
1
2.1k
365日24時間稼働必須サービスの 完全無停止DB移行
kyuden
23
11k
Rails Authorization
kyuden
21
15k
One Night Vue.js
kyuden
14
3.8k
Other Decks in Programming
See All in Programming
霧の中の代数的エフェクト
funnyycat
1
410
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
360
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
170
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
1k
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
180
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
180
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
340
Android CLI
fornewid
0
110
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
120
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
540
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
270
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
0
280
Featured
See All Featured
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
320
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Mind Mapping
helmedeiros
PRO
1
290
Mobile First: as difficult as doing things right
swwweet
225
10k
How to build a perfect <img>
jonoalderson
1
5.8k
30 Presentation Tips
portentint
PRO
1
350
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
200
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Product Roadmaps are Hard
iamctodd
55
12k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Technical Leadership for Architectural Decision Making
baasie
3
440
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
56k
Transcript
Why? Rails 5.1 Kyuden Masahiro
whoami • Name: Kyuden Masahiro • Github: kyuden • Twitter:
@kyuden_ • Gems: – sorcery: committer • https://github.com/Sorcery/sorcery – banken : creator • https://github.com/kyuden/banken
5 分で Web サービスを 30 ヶ国語対応
None
Rails 5.1 の新機能 / 変更点を一部紹介しますが、最後に脱線します
form_with
form_with • form_for と form_tag が form_with に統 合された –
統合だけでなく、いくつか改善も行われており form_for や form_tag と少しデフォルトの挙動 が違うので注意が必要 – form_for と form_tag は今後 deprecate にな る予定
form_with `model:` を使うと form_for のようなモデ ルに基づいたフォームが生成できる
form_with `url:` を使うと form_tag のようなモデルに 基づかないフォームを生成できる
Why?
form_with https://github.com/rails/rails/issues/25197
form_with • form_with はデフォルト `remote: true` • 次の設定を false に設定することでデフォルトを
local: true に変更できる config.action_view.form_with_generates_remote_ forms = false
Why?
form_with https://github.com/rails/rails/issues/25197
form_with • form_with はデフォルトで form タグや Input タグに class 属性や
id 属性を付与しない
Why?
form_with https://github.com/rails/rails/issues/25197
form_with • form_with で form タグに class 属性や id 属
性などの HTML 属性を付与する際 `html{}` で ラップする必要はない
Why?
form_with https://github.com/rails/rails/issues/25197
form_with • form_with はモデルの属性に存在しないフィー ルドを FormBuilder オブジェクト経由で指定で きる
Why?
form_with https://github.com/rails/rails/issues/25197
Encrypted secrets
Encrypted secrets • config/secrets.yml とは別に秘匿情報を管 理する仕組み • 暗号化して管理できることが特徴
Encrypted secrets bin/rails secrets:setup
Encrypted secrets EDITOR=vim bin/rails secrets:edit
Encrypted secrets • 暗号化 / 複合のための鍵は config/secrets.yml.key に定義する以外に 環境変数 $RAILS_MASTER_KEY
に設定す ることも可能 • Rails5.1 で新規に作られたアプリ以外はデフ ォルトでは Encrypted secrets を読み込む 以下の設定が false になっているので注意 config.read_encrypted_secrets = true • 暗号化方式は aes-128-gcm
Why?
Encrypted secrets • config/secrets.yml に秘匿情報をベタ書きす るとセキュリティ的にバージョン管理できない ⬇ 秘匿情報ごとに環境変数を用意し実際の値は外部の リポジトリやサービスで管理するなどして運用 ⬇
しかし、アプリケーションコードと秘匿情報の管理 場所が異なると、どの時点のアプリケーションコー ドがどのような秘匿情報を必要とするのか把握する のが難しい ( 工夫が必要 ) ⬇ そう考えると、アプリケーションコードと共にバー ジョン管理できた方がいい ⬇ バージョン管理するためには暗号化が必要 ◦ そこで Encrypted secrets
Encrypted secrets • なぜ config/secrets.yml は 5.1 でも残っているのか • なぜフォーマットは
YAML なのか、 etc https://github.com/rails/rails/issues/25095
Keep Motivation
Keep Motivation ⬇ そこそこ長く Rails( 特定のフレームワーク ) を 使って詳しくなると Rails
への興味が徐々に薄れ ていく ( 自分の場合は ) 。 ⬇ Rails の新バージョンがリリースされると、新し い機能や変更点は一応確認するが、 Rails の知識 がついても自分の力になっている感じがしない ( 興味が薄れるとなおさらそう感じる ) 。
Keep Motivation ⬇ DHH などがたてた新しい機能や大きな変更点の案 が記載された ISSUE やコメントでの議論を読んで その Why
を知ると、いろいろな学びがある。 ⬇ そこで得た学びは Rails に限らず、他のフレーム ワークを使う場合や、設計で悩んだ際にも応用でき る。 ⬇ Rails に慣れて取れ高が少なくなってきた方なんか は、 ISSUE やコメントでの議論の内容がよくわか ると思うので特に楽しめるかも? ◦ モチベーションを保てる!
Rails 5.1 の新機能 / 変更点 全然紹介できてない ..
続きは WEB+DB PRESS で !