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
79
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
210
Garbage Collection em Ruby
laurocaetano
2
110
Clojure Introduction.
laurocaetano
1
62
Other Decks in Programming
See All in Programming
哲学史とモデリング
tanakahisateru
2
430
Timeline エディター拡張入門
yucchiy
0
450
Introducing Kotlin Multiplatform in an existing mobile app - Workshop Edition | AndroidMakers Paris
prof18
0
180
TypeScriptでもLLMアプリケーション開発 / LLM Application In Typescript
rkaga
5
1.3k
Docker_OSS_ホスティング入門
satokoki645
0
140
Powerfully Typed TypeScript
euxn23
4
1.7k
Using "modern" Ruby to build a better, faster Homebrew
mikemcquaid
2
280
チーム立ち上げにAWSを活用したらClaudeさんに褒められた話
mkdev10
3
230
一文字エイリアスのすすめ
fujimura
0
200
TypeScript Custom GitHub Action Development Tips
peaceiris
5
650
CQRS meets modern Java
simas
PRO
2
480
[RubyKaigi 2024] Ruby Mixology 101: adding shots of PHP, Elixir, and more
palkan
0
130
Featured
See All Featured
Done Done
chrislema
178
15k
Typedesign – Prime Four
hannesfritz
36
2.1k
Rebuilding a faster, lazier Slack
samanthasiow
74
8.3k
Producing Creativity
orderedlist
PRO
338
39k
Designing on Purpose - Digital PM Summit 2013
jponch
111
6.5k
Robots, Beer and Maslow
schacon
PRO
155
8k
The Mythical Team-Month
searls
217
42k
Side Projects
sachag
451
41k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
67
14k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
275
13k
KATA
mclloyd
16
12k
A Philosophy of Restraint
colly
197
16k
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