Skip mailers while generating Rails 5 app

Abhishek Jain

Abhishek Jain

July 8, 2016

This blog is part of our  Rails 5 series.

We can now skip requiring Action Mailer while generating Rails 5 app.

1
2$ rails new my_app --skip-action-mailer
3
4# OR
5
6$ rails new my_app -M
7

This comments out requiring action_mailer/railtie in application.rb.

It also omits mailer specific configurations such as config.action_mailer.raise_delivery_errors and config.action_mailer.perform_caching in production/development and config.action_mailer.delivery_method by default in test environment.

1
2# application.rb
3
4require "rails"
5require "active_model/railtie"
6require "active_job/railtie"
7require "active_record/railtie"
8require "action_controller/railtie"
9# require "action_mailer/railtie"
10require "action_view/railtie"
11require "action_cable/engine"
12require "sprockets/railtie"
13require "rails/test_unit/railtie"
14

As, we can see action_mailer/railtie is commented out.

If this blog was helpful, check out our full blog archive.

Stay up to date with our blogs.

Subscribe to receive email notifications for new blog posts.