Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
What's new in Rails 4.1
Search
Lauro Caetano
January 28, 2014
Programming
0
94
What's new in Rails 4.1
Lauro Caetano
January 28, 2014
Tweet
Share
More Decks by Lauro Caetano
See All by Lauro Caetano
Learning Elixir by Examples
laurocaetano
1
230
Garbage Collection em Ruby
laurocaetano
2
130
Clojure Introduction.
laurocaetano
1
75
Other Decks in Programming
See All in Programming
AIコーディングエージェント(skywork)
kondai24
0
160
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
310
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
130
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
200
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
370
How Software Deployment tools have changed in the past 20 years
geshan
0
29k
20 years of Symfony, what's next?
fabpot
2
350
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
26
22k
dotfiles 式年遷宮 令和最新版
masawada
1
750
Microservices rules: What good looks like
cer
PRO
0
1.2k
WebRTC と Rust と8K 60fps
tnoho
2
2k
Featured
See All Featured
The Language of Interfaces
destraynor
162
25k
Unsuck your backbone
ammeep
671
58k
Building Flexible Design Systems
yeseniaperezcruz
330
39k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
GraphQLとの向き合い方2022年版
quramy
50
14k
Raft: Consensus for Rubyists
vanstee
141
7.2k
Building Applications with DynamoDB
mza
96
6.8k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
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