Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Why Rails 5.1
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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.2k
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
アクセシビリティから考える情報設計
high_g_engineer
0
370
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
240
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
190
A2UI for Android: Safely Rendering AI-Generated UI with Jetpack Compose - DroidKaigi 2026
itsmedreamwalker
0
140
DroidKaigi 2026 「個人開発という実験場: Android エンジニアが手にする4つの自由」
slashnephy
0
230
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
370
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
140
Intent as Code
shoppingjaws
6
1k
Go のフラットな パッケージに 「ファイル単位の private」を 〜Linter “declscope” を作った話〜
mpyw
0
310
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
270
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
200
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.1k
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Optimizing for Happiness
mojombo
378
71k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Unsuck your backbone
ammeep
672
58k
GitHub's CSS Performance
jonrohan
1033
470k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
How to Ace a Technical Interview
jacobian
281
24k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
240
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
480
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
The SEO Collaboration Effect
kristinabergwall1
1
560
Thoughts on Productivity
jonyablonski
76
5.4k
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 で !