It was December 2015 when Ruby on Rails announced the first beta release of Rails 5.0, and yesterday, after four betas, two release candidates, and hundreds of contributors, Rails 5.0 is finally done.
(Related: Rails is popular with coding boot camps)
According to the Ruby on Rails team, Action Cable makes designing live features like chat, notifications and presence easier. For those developers who want to see a live use case, these features are currently a part of Basecamp 3, a private, secure collaborative space for developers.
The Rails team also added an ActionController::Renderer system, and Action Cable allows developers to access their entire Active Record and PORO domain model in their WebSockets work. Action Cable runs in-process with the rest of an app, and the team recommended running Action Cable servers in their own processes (which is how Basecamp runs at scale).
“If you create a new Rails application using Rails’ new back end -api, you’ll get a slimmed-down skeleton and configuration that assumes you’ll be working with JSON, not HTML,” according to the team.
More work needs to be done for API mode, but for now, by default it relies on #to_json calls on model classes.
Other highlights of the release include:
- The test runner now reports failures inline, so developers don’t have to complete the suite to see what went wrong.
- ApplicationRecord has been born as a default parent class of all models created by the generators.
- No more accidentally halting Active Record callbacks because the last statement is false.