Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
Transcript
17 slides
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
More Decks by Lauro Caetano
See All by Lauro Caetano
Learning Elixir by Examples
laurocaetano
1
250
Garbage Collection em Ruby
laurocaetano
2
150
Clojure Introduction.
laurocaetano
1
90
Other Decks in Programming
See All in Programming
Crash Auto Pipelines
veronikapj
1
410
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
まずはコードより業務と向き合う:テーブル解体のためにPdMを呼んだ話
sakawe_ee
0
210
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
340
AmebaブログはKMPから卒業します
kmars0605
0
340
AI Augmentation Techniques with Liberty
ivargrimstad
1
450
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
610
AI-Powered Domain-Driven Design
ziobrando
0
430
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
130
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.3k
Snowflake Openflow Connector利用の勘所 / 20261024developersio2026tokyo-snowflake-openflow
kasacchiful
PRO
0
330
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
310
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Product Roadmaps are Hard
iamctodd
55
13k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Automating Front-end Workflow
addyosmani
1370
210k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Bash Introduction
62gerente
615
220k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.7k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
400
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k