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
Lauro Caetano
January 28, 2014
Programming
0
87
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
220
Garbage Collection em Ruby
laurocaetano
2
120
Clojure Introduction.
laurocaetano
1
71
Other Decks in Programming
See All in Programming
型で語るカタ
irof
1
880
DataformでPythonする / dataform-de-python
snhryt
0
110
202507_ADKで始めるエージェント開発の基本 〜デモを通じて紹介〜(奥田りさ)The Basics of Agent Development with ADK — A Demo-Focused Introduction
risatube
PRO
5
1.3k
DMMを支える決済基盤の技術的負債にどう立ち向かうか / Addressing Technical Debt in Payment Infrastructure
yoshiyoshifujii
4
670
[SRE NEXT] 複雑なシステムにおけるUser Journey SLOの導入
yakenji
1
850
商品比較サービス「マイベスト」における パーソナライズレコメンドの第一歩
ucchiii43
0
230
変化を楽しむエンジニアリング ~ いままでとこれから ~
murajun1978
0
590
코딩 에이전트 체크리스트: Claude Code ver.
nacyot
0
1k
The Modern View Layer Rails Deserves: A Vision For 2025 And Beyond @ RailsConf 2025, Philadelphia, PA
marcoroth
2
830
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
0
600
[Codecon - 2025] Como não odiar seus testes
camilacampos
0
100
Gemini CLI のはじめ方
ttnyt8701
1
110
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Statistics for Hackers
jakevdp
799
220k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Rails Girls Zürich Keynote
gr2m
95
14k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
400
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
110
19k
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