New Features in Rails 6.0 - Part 1

List of changes in Rails 6.0, and how to use them.

Rails 6.0 is scheduled to be release in the coming months. This posts explores what is new in Rails 6.0 and references to what needs to be done to implement them in your project.

Rails 6.0.0 rc1 has been released. It will require Ruby 2.5.0 or above. So what’s new?

Action Text for rich text content with Trix Editor.

Action Mailbox for inbound email.

Parallel Testing by default.

New multi-db support.

Zeitwork code loader

Lets explore each one shortly, and I’ll give you links on tutorials on each specific topic.

…

Action Text

Action Text brings easy rich text editing to Rails. It introduces a has_rich_text DSL in the model for a text field and a form helper form.rich_text_area to show the Trix rich text editor. Also, the field will be renderend in erb as rich text.

Steps to use

Lets say we have an BlogPost model with title:string and content:text fields. After setting up the migrations, you need to install Action Text.

bundle exec rails action_text:install

This will copy the ActionStorage and ActionText migrations to your Rails app migrations folder. It creates the tables action_text_rich_texts, active_storage_attachments and active_storage_blobs.

Steps to use

Create a new password for access of ActionMailbox. Use rails credentials:edit to add the ingress_password key in the file that opens up during credentials:edit.

Note: This is not your Sendgrid password, its a password to protect your inbound email endpoint.

action_mailbox:
ingress_password:

Then configure Sendgrid with the url: /rails/action_mailbox/sendgrid/inbound_emails with the username: actionmailbox and the password set above. For example if your application is served from https://abc123.com SendGrid should be configured with the url: