In Week 4 of Intro to Rails Workshop, I have noticed the use of pluralized controllers like
homes_controller, where probably is more natural to read it as
home_controller. Its path/route is hidden in this case by being mapped to
root_path. But, if we wanted to expose it, the url will read something like http://localhost:3000/homes .
Whilst it makes sense to pluralize the controller’s names when they are tight to a model, what is the best practice when they are model-less, and it is just more natural to read them in singular?
- As the plural is just a convention, use the singular in naming our controllers in such cases. (e.g.
- Use the plural in naming the controllers (e.g.
searches_controller, etc.), but mapping them with
resourcein singular, in the