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
Kyuden Masahiro
June 28, 2017
Programming
1
720
Why Rails 5.1
MedBeer -Rails 5.1での開発について
https://medpeer.connpass.com/event/58805/
Kyuden Masahiro
June 28, 2017
Tweet
Share
More Decks by Kyuden Masahiro
See All by Kyuden Masahiro
Red-Black Tree for Ruby
kyuden
1
1.8k
365日24時間稼働必須サービスの 完全無停止DB移行
kyuden
23
10k
Rails Authorization
kyuden
21
14k
One Night Vue.js
kyuden
14
3.7k
Other Decks in Programming
See All in Programming
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
200
20250708_JAWS_opscdk
takuyay0ne
2
130
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
1
7.3k
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
5
1.1k
Claude Code派?Gemini CLI派? みんなで比較LT会!_20250716
junholee
1
530
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
0
260
猫と暮らす Google Nest Cam生活🐈 / WebRTC with Google Nest Cam
yutailang0119
0
170
AI Agent 時代のソフトウェア開発を支える AWS Cloud Development Kit (CDK)
konokenj
6
800
「テストは愚直&&網羅的に書くほどよい」という誤解 / Test Smarter, Not Harder
munetoshi
0
200
Porting a visionOS App to Android XR
akkeylab
0
680
テストから始めるAgentic Coding 〜Claude Codeと共に行うTDD〜 / Agentic Coding starts with testing
rkaga
15
5.6k
テスト駆動Kaggle
isax1015
1
620
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
173
14k
Writing Fast Ruby
sferik
628
62k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
The Invisible Side of Design
smashingmag
301
51k
We Have a Design System, Now What?
morganepeng
53
7.7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
Producing Creativity
orderedlist
PRO
346
40k
Faster Mobile Websites
deanohume
308
31k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.6k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
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 で !