Railsfactory Blog

Rails 6 : New Updates and Features

Rails 6 will release soon amidst the frenzy among the rails communities. Rails 6 will only be using ruby version 2.5 or greater. It has introduced some nice and exciting features and updates.


ActionText– ActionText allows render and saving of rich text using rails app. It includes ‘Trix Editor’ which handles everything from formatting links to quotes to lists to embedded images and galleries. The rich text generated is saved in its own RichText model that’s associated with any existing Active Record model in the application. In earlier version of rails, developers most commonly used WSIWYG editors which would save your entire document as HTML plus any images and attachments, would store it and on rendering it would just sanitise the HTML to re-render it. In action text, the attachments, images or documents, are stored as a reference and on render, its queried from the database to get the required fields, hence getting the updated value as opposed to the old value which users would get in case of WSISYG editors, in case the resource has been updated.

To see on how to use, please refer https://edgeguides.rubyonrails.org/action_text_overview.html

ActionMailbox– Action Mailbox is a brand new framework introduced which allows users to store the incoming mail in their application along with the features given by Action Mailer, which will be deprecated in upcoming version of rails. Action Mailbox requires Active Job and Active Storage as part of it’s configuration and a database table.

On installation and usage please refer :- https://edgeguides.rubyonrails.org/action_mailbox_basics.html

Multiple DB Support– Rails 6 offers multiple database support. For earlier versions, developers used to install external gems which offers multiple database support to their application. Now this feature is incorporated into rails itself. The connect_to is used to pass configuration for read and write operations from multiple database. The database.yml file needs to be configured first in order to use multiple databases.

The pull request can be found at: https://github.com/rails/rails/pull/34196

Parallel testing– With rails 6 parallel testing is introduced. So, a number of tests can now be run in parallel. The developers have to configure the test_helper.rb file and add parallelize(workers: n) where n is the no of times process will be forked. Separate databases are automatically created and schemas are loaded into it for each process, and this is handled by ActiveRecord. Using this feature, the test cases can now be run in less time and long test suites can be forked as per your machine, which can differ for various environments.

For further usage, please refer — https://edgeguides.rubyonrails.org/testing.html#parallel-testing

Rails 6 seems to have exciting features and has become the most anticipated release for the rails developers which can be used to enhance their app and gives them an ease of use edge.

Your Header Sidebar area is currently empty. Hurry up and add some widgets.