Photo by Joshua Fuller on Unsplash
What's Coming in Rails 5
3 min read
Rails 5As has become tradition, a new full version release of Rails is coming just two years after the release of Rails 4. This new version progresses the platform by bumping the underlying minimum Ruby version and adds a slew of neat features to keep Rails feeling fresh and new.
Ruby 2.2.2 is required in Rails 5 because Rails 5 will take advantage of the new Symbol Garbage Collection found in Ruby 2.2. There is also rumor of Rails 5 using the Incremental Garbage Collection found in Ruby 2.2. They have decided to use Ruby 2.2.2 since Ruby 2.2 had a major security vulnerability that is patched in 2.2.2.
https://github.com/rails/rails/pull/19257 Ruby 2.2.1 PR
https://github.com/rails/rails/commit/32f7491808d2c4e097ed7b3ee875e4d1cea8c442 Ruby 2.2.2 Commit
rails new <application name> --api and Rails will create your new API app all on its own!
Here are a couple of tutorials for you Backbone and Ember users.
Action Cable is the feature I am most excited about. Simpler web sockets for Rails. Anytime anyone says web sockets to me I cringe a little just because of how complicated they can be to set up. Many have tried to make the problem easier and Action Cable is Rails' way of giving it a try.
Rake or Rails
The beginner's dillema, do I use
rake db:migrate or
rails db:migrate, is it
rake test or
rails test? Doesn't matter anymore, it's all
rails. From Rails 5 on the
rails command can be used to run
rake commands. Simple change but a nice one.
Rails 5 is beginning a push to deprecate Controller tests all together in favor of Integration tests. As part of that they are deprecating
assert_template in controller tests. Aaron Patterson has a great keynote from Railsconf where he outlines the speed improvements made to the Rails testing environment and why Integration tests will be the way to go.