DEV Community

Cover image for Active Support Rails
Ajithkumar P S
Ajithkumar P S

Posted on • Edited on

Active Support Rails

Hello all Rubyists, This is my first blog post on dev.to and I'm very excited to start off. Here we go, As per ruby on rails guide, Active Support is the Ruby on Rails component responsible for providing Ruby language extensions and utilities.

Active Support in Ruby on Rails enhances the capabilities of the Ruby language by adding more features and utilities, making it easier for developers to build web applications efficiently.

What does that really mean?

It means that you can do a lot of really cool stuffs with Active Support that you cannot do in regular Ruby code. For example, When I use 'person'.pluralize in an irb and see what happens below

.pluralize method in IRB

We are getting NoMethodError in Ruby — that’s where ActiveSupport can come in. Active Support automatically provides methods, such as .pluralize, .singularize and many more methods to Rails applications. The same method in a rails console.

.pluralize method in rails console

Now it works! It is just an intro to Active Support. There many more methods available. Please checkout the official docs to know more. active support guide Thanks for reading!

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (2)

Collapse
 
pimp_my_ruby profile image
Pimp My Ruby

Hi ! Welcome on Dev.to :)

What are the top 6 methods you like the most on ActiveSupport ?

Collapse
 
iamak profile image
Ajithkumar P S

Hi @V These are my favorite methods:

  1. beginning_of_day
  2. with_indifferent_access
  3. presence
  4. pluck
  5. merge
  6. except

AWS Q Developer image

Your AI Code Assistant

Generate and update README files, create data-flow diagrams, and keep your project fully documented. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE