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
アクセシビリティの観点からみたFluent UI Blazorのすすめ
tomokusaba
1
180
スタックトレース始めてみた
kuro_kurorrr
5
1.3k
[RubyKaigi 2024] Ruby Mixology 101: adding shots of PHP, Elixir, and more
palkan
1
390
Community-driven RBS repository
pocke
2
390
gRPCでの効率的なAPI開発とテストの進め方
uo
2
170
slog登場に伴うloggerの取り回し手法の見直し / kamakura.go #6
arthur1
1
430
Optiver参戦記&銀メダル解法
tonic
0
210
AFUP Day Lyon 2024 - DDD !== Archi hexagonale
bgalati
0
190
AIで生成したものをAIでチェックしてる話
ippey
0
130
20240525_社内でPower Platform勉強会開いたら900人来た話
ponponmikankan
0
540
メッセージとイベントを中核に置いたシステム設計の有用性について
j5ik2o
PRO
8
600
プログラミング&実行できるWEBアプリを手作り
ohmori_yusuke
3
200
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
76
5.3k
The Art of Programming - Codeland 2020
erikaheidi
43
12k
Bash Introduction
62gerente
605
210k
Build your cross-platform service in a week with App Engine
jlugia
227
17k
[RailsConf 2023] Rails as a piece of cake
palkan
30
4.1k
How GitHub (no longer) Works
holman
305
140k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
660
120k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
The Mythical Team-Month
searls
217
42k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
126
32k
Being A Developer After 40
akosma
67
580k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
23
1.7k
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