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
What's new in Rails 4.1
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Lauro Caetano
January 28, 2014
Programming
100
0
Share
What's new in Rails 4.1
Lauro Caetano
January 28, 2014
More Decks by Lauro Caetano
See All by Lauro Caetano
Learning Elixir by Examples
laurocaetano
1
240
Garbage Collection em Ruby
laurocaetano
2
140
Clojure Introduction.
laurocaetano
1
82
Other Decks in Programming
See All in Programming
Modding RubyKaigi for Myself
yui_knk
0
860
AIエージェントの隔離技術の徹底比較
kawayu
0
450
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
5.2k
Oxcを導入して開発体験が向上した話
yug1224
4
280
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
150
3Dシーンの圧縮
fadis
1
580
GitHub Copilot CLIのいいところ
htkym
2
1.2k
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.2k
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
140
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.8k
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
240
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
220
Featured
See All Featured
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
380
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Site-Speed That Sticks
csswizardry
13
1.2k
Claude Code のすすめ
schroneko
67
220k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
300
Producing Creativity
orderedlist
PRO
348
40k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
570
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
The Curse of the Amulet
leimatthew05
1
13k
Transcript
What’s new in Rails 4.1 Lauro Caetano 28/01/2014
Major Features
Spring
! # bundle exec spec spec/models/book_spec.rb! # 15.30s user 1.63s
system 99% cpu 16.976 total! 12 examples, 0 failures ! ! # bin/spring rspec spec/models/book_spec.rb! # 1.01s user 0.10s system 17% cpu 6.453 total! 12 examples, 0 failures
config/secrets.yml
# config/secrets.yml! development:! secret_key_base: 3b7cd727ee24e8444053437! some_api_key: SOMEKEY! ! ! Rails.application.secrets.some_api_key!
# => SOMEKEY!
Action Pack Variants
class ApplicationController < ActionController::Base! def some_action! respond_to do |format|! format.html
do |html|! html.tablet ! html.phone! end! end! end! end! ! # in app/views/projects/show.html+tablet.erb! # in app/views/projects/show.html+phone.erb
class ApplicationController < ActionController::Base! def some_action! respond_to do |format|! format.js
{ render "trash" }! format.html.phone { redirect_to progress_path }! format.html.none { render "trash" }! end! end ! end
Action Mailer Previews
class NotifierPreview < ActionMailer::Preview! def welcome! Notifier.welcome(User.first)! end ! end!
# => http://localhost:3000/rails/mailers! # in /test/mailers/previews/notifier_preview.rb
Active Record Enum
class Conversation < ActiveRecord::Base! enum status: [:active, :archived]! end! !
conversation.archived!! conversation.active?! # => false! conversation.status! # => "archived"! ! Conversation.archived! # => Relation for all archived Conversations!
class Conversation < ActiveRecord::Base! enum status: { active: 0, archived:
1 }! end! ! conversation.archived!! conversation.active?! # => false! conversation.status! # => "archived"! ! Conversation.archived ! # => Relation for all archived Conversations!
Message Verifiers
signed_token = Rails.application! .message_verifier("remember_me")! .generate(“some data")! ! Rails.application.message_verifier("remember_me")! .verify(signed_token)! #
=> some data!
Removals, Deprecations and notable changes ! https://github.com/rails/rails/blob/master/guides/ source/4_1_release_notes.md