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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Lauro Caetano
January 28, 2014
Programming
0
100
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
140
Clojure Introduction.
laurocaetano
1
77
Other Decks in Programming
See All in Programming
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
680
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
120
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
160
ご飯食べながらエージェントが開発できる。そう、Agentic Engineeringならね。
yokomachi
1
290
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
7.7k
開発ステップを細分化する、破綻しないAI開発体制
kspace
0
110
TROCCOで実現するkintone+BigQueryによるオペレーション改善
ssxota
0
140
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
200
文字コードの話
qnighy
44
17k
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
220
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
360
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
180
Featured
See All Featured
My Coaching Mixtape
mlcsv
0
64
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
460
A Modern Web Designer's Workflow
chriscoyier
698
190k
Designing for Performance
lara
611
70k
KATA
mclloyd
PRO
35
15k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
How to Think Like a Performance Engineer
csswizardry
28
2.5k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
110
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
140
Prompt Engineering for Job Search
mfonobong
0
180
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