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
84
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
68
Other Decks in Programming
See All in Programming
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
630
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
10
1.4k
さいきょうのレイヤードアーキテクチャについて考えてみた
yahiru
1
540
2025.01.17_Sansan × DMM.swift
riofujimon
2
670
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
18
3.3k
富山発の個人開発サービスで日本中の学校の業務を改善した話
krpk1900
3
310
Java Webフレームワークの現状 / java web framework at burikaigi
kishida
9
2k
【PHP】破壊的バージョンアップと戦った話〜決断と説得
satoshi256kbyte
0
100
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
140
ISUCON14公式反省会LT: 社内ISUCONの話
astj
PRO
0
140
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
1
3.3k
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
990
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Faster Mobile Websites
deanohume
305
30k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Being A Developer After 40
akosma
89
590k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
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