Posted 27 days ago. Visible to the public. Repeats.

Rails: Do not load frameworks you don't need

Rails is split into a large number of (sub-) frameworks.

The most important and central of those are

  • activesupport (extends the Ruby standard library)
  • activerecord / activemodel (ORM for Rails)
  • actionview / actionpack (controller / views)
  • actionmailer (sends mails)

However, there are also some more situational frameworks included, such as

  • actioncable (real time communications using websockets)
  • actionmailbox (receives mails)
  • actiontext (support for WYSIWYG text editor)
  • activejob (background jobs)
  • activestorage (file upload and storage)
  • sprockets (the old "asset pipeline")

You might not need all of these frameworks in every app, so in the interest of startup time and memory usage, you can disable them. To do that, simply comment out the appropriate lines in config/application.rb. You'll also have to remove some configuration options, but you'll receive appropriate error messages.

If your application.rb only has require 'rails/all', you need to replace that line with individual requires for the frameworks you would like to keep.

makandra has been working exclusively with Ruby on Rails since 2007. Our laser focus on a single technology has made us a leader in this space.

Owner of this card:

Avatar
Tobias Kraze
Last edit:
20 days ago
by Besprechungs-PC
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Tobias Kraze to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more