Modules vs Concerns
TypeFast
www.typefast.co/
Modules is ruby's version of the classic interface available in other programming languages.
Ruby on Rails however has something called Concerns, which look like a module but seems to be a little different to someone who may not be familiar with the differences.
In this video, I go over the main differences and similarities between module and concerns.
Пікірлер: 6
the behavior in Rails is likely to have its root in the difference between include and extend. When using include you need the object to be initialized, while extend does not require the object to be initialized to call a method. I would not be surprised that in Rails the validation is taking place before the object is initialized, thus the use of extend and the include do block.
Great video man! What a great explanation about this two features. I saw a project where modules are located on lib folder and are used as concerns.
Really great videos, thank you so much!
Thanks
Thanks!!!
Thanks