DEV Community

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

Posted on • Updated 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!

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