Some Rails' parts start with "Active":
And some Rails' parts start with "Action":
Why is that? Why don't they all have the same prefix? And what do "Active" and "Action" mean in this context?
DHH is now building "ActiveJob", and how did he know if it wasn't supposed to be "ActionJob"?
Naming conventions in Active Record model Rails is capable of pluralizing (and singularizing) both regular and irregular words. Model class names must use the CamelCase form when composed of two or more words, while the database table names must use the snake_case form.
If the controller is a resource then it must be plural... Show activity on this post. The naming convention of controllers in Rails favors pluralization of the last word in the controller's name, although it is not strictly required (e.g. ApplicationController ).
The way I look at it, again this is just my perspective (the only person who can give a confirmed answer is DHH :) ),
When I see Action*
like ActionPack
(ActionView
and ActionController
are the two major components of ActionPack
) or ActionMailer
, they pertain to an action performed within the Rails application be it a controller specific action or displaying a particular view or even sending an email. So, Action
seems precise prefix here as these packages denote doing something.
When I see Active*
like ActiveRecord
, ActiveSupport
or ActiveModel
etc., it somehow relates to providing some useful functionality to your Rails applications business logic be it utility methods or ORM support kind of like add-ons to facilitate the Rails application development.
Hope to see more interesting answers on this question. This is where we can start analyzing.
Action* is for user facing stuff (views, controllers, mailers) and Active* are backend components that supports the Action* components
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With