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
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
250
Garbage Collection em Ruby
laurocaetano
2
140
Clojure Introduction.
laurocaetano
1
86
Other Decks in Programming
See All in Programming
ソフトウェアラスタライザ
fadis
1
760
Press start. Python's next generation.
willingc
PRO
3
300
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
4
2.4k
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.4k
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
49
31k
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
590
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
360
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
500
高専キャリア LT 発表内容
crysta1221
6
5.4k
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
570
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
400
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
120
Featured
See All Featured
A Soul's Torment
seathinner
7
3.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Site-Speed That Sticks
csswizardry
13
1.5k
The SEO Collaboration Effect
kristinabergwall1
1
540
Code Review Best Practice
trishagee
74
20k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
Building Adaptive Systems
keathley
44
3.2k
The SEO identity crisis: Don't let AI make you average
varn
0
550
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
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