Ask A Question


You’re not receiving notifications from this thread.

Controller naming...

Alan Reid asked in Rails

Evening all,
So i have a question about naming controllers. Which would be best to use? MyOrder or MyOrders

Is it just the DB which get pluralised?


It's convention to use the plural form for your controllers.

OrdersController -> app/controllers/orders_controller.rb, a model would be Order

If you think about it, when you define a route you most likely use resources :orders in that circumstance. Then Rails knows it's looking for an orders controller.

I hope that helps?


Cheers Andrew,
Orders makes much more sense :D thanks

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,453+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.