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
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
78
Other Decks in Programming
See All in Programming
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
290
モダンOBSプラグイン開発
umireon
0
190
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
770
PHPで TLSのプロトコルを実装してみる
higaki_program
0
730
安いハードウェアでVulkan
fadis
1
870
AI 開発合宿を通して得た学び
niftycorp
PRO
0
190
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
130
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
120
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
220
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
8
4.1k
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
390
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
5.9k
Designing for Timeless Needs
cassininazir
0
180
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
A Tale of Four Properties
chriscoyier
163
24k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
660
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
500
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
320
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