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
100
0
Share
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
240
Garbage Collection em Ruby
laurocaetano
2
140
Clojure Introduction.
laurocaetano
1
78
Other Decks in Programming
See All in Programming
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
3
280
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
140
AI-DLC Deep Dive
yuukiyo
9
4.2k
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
140
How Swift's Type System Guides AI Agents
koher
0
270
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
3
320
10 Tips of AWS ~Gen AI on AWS~
licux
5
410
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
3k
AIエージェントで業務改善してみた
taku271
0
530
Don't Prompt Harder, Structure Better
kitasuke
0
770
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
2
190
iOS機能開発のAI環境と起きた変化
ryunakayama
0
180
Featured
See All Featured
Optimizing for Happiness
mojombo
378
71k
The SEO Collaboration Effect
kristinabergwall1
1
420
How STYLIGHT went responsive
nonsquared
100
6.1k
Claude Code のすすめ
schroneko
67
220k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
53k
Chasing Engaging Ingredients in Design
codingconduct
0
170
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Tell your own story through comics
letsgokoyo
1
900
Statistics for Hackers
jakevdp
799
230k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
510
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
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