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
85
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
69
Other Decks in Programming
See All in Programming
Devin入門 〜月500ドルから始まるAIチームメイトとの開発生活〜 / Introduction Devin 〜Development With AI Teammates〜
rkaga
3
1.4k
機能が複雑化しても 頼りになる FactoryBotの話
tamikof
1
260
オレを救った Cline を紹介する
codehex
16
15k
Datadog DBMでなにができる? JDDUG Meetup#7
nealle
0
160
Djangoにおける複数ユーザー種別認証の設計アプローチ@DjangoCongress JP 2025
delhi09
PRO
4
520
Introduction to C Extensions
sylph01
3
130
ML.NETで始める機械学習
ymd65536
0
250
PHPカンファレンス名古屋2025 タスク分解の試行錯誤〜レビュー負荷を下げるために〜
soichi
1
770
バッチを作らなきゃとなったときに考えること
irof
2
560
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
280
AIプログラミング雑キャッチアップ
yuheinakasaka
21
5.4k
Goで作るChrome Extensions / Fukuoka.go #21
n3xem
0
150
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Building Your Own Lightsaber
phodgson
104
6.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.4k
Typedesign – Prime Four
hannesfritz
41
2.5k
Raft: Consensus for Rubyists
vanstee
137
6.8k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.3k
Gamification - CAS2011
davidbonilla
80
5.2k
What's in a price? How to price your products and services
michaelherold
244
12k
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