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
210
Garbage Collection em Ruby
laurocaetano
2
120
Clojure Introduction.
laurocaetano
1
67
Other Decks in Programming
See All in Programming
Ebitengineの1vs1ゲーム WebRTCの活用
ponyo877
0
380
From Idea to IDE: Developing Plugins for Android Studio
thisaay
1
220
実践!難読化ガイド
mitchan
0
200
AndroidアプリのUIバリエーションをあの手この手で確認する / Check UI variations of Android apps by various means
tkmnzm
1
170
Amazon BedrockでサーバレスなAIお料理ボットを作成する!!
tosuri13
0
230
状態管理ライブラリZustandの導入から運用まで
k1tikurisu
3
470
仮想ファイルシステムを導入して開発環境のストレージ課題を解消する
segadevtech
2
550
Perl 5 OOP機構30年史 - Perl 5's OOP Mechanism over the past 30 years
moznion
0
270
Shinjuku.rb#95:心の技術書紹介
free_world21
1
110
令和トラベルにおけるLLM活用事例:社内ツール開発から得た学びと実践
ippo012
0
210
What you can do with Ruby on WebAssembly
kateinoigakukun
0
170
マルチモジュールにおけるテスト最適化
fxwx23
0
210
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
31
2.8k
Side Projects
sachag
451
42k
Building an army of robots
kneath
302
42k
The Mythical Team-Month
searls
218
43k
How GitHub (no longer) Works
holman
310
140k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
58k
GitHub's CSS Performance
jonrohan
1030
450k
How to train your dragon (web standard)
notwaldorf
85
5.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
38
9.2k
How To Stay Up To Date on Web Technology
chriscoyier
786
250k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
32k
Creatively Recalculating Your Daily Design Routine
revolveconf
215
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