How to use concerns in Rails 4

The default Rails 4 project generator now creates the directory “concerns” under controllers and models. I have found some explanations about how to use routing concerns, but nothing about controllers or models.

I am pretty sure it has to do with the current “DCI trend” in the community and would like to give it a try.

The question is, how am I supposed to use this feature, is there a convention on how to define the naming / class hierarchy in order to make it work? How can I include a concern in a model or controller?

6 s
6

Leave a Comment