plural/singular controller name
I know that using plural for controllers name is the right way in Ruby, but in some cases using singular for controllers name is more appropriately. For example
http://foobar.com/admin/login/ http://foobar.com/admin/dashboard/ http://foobar.com/profile/
I think you get what I mean. So which are the best practices of using singular for controllers names ?
Any example will be appreciated !
If you don't need the whole scaffolding, for example you probably have no admin model, then you can just generate a controller with a singular name.
rails g controller admin
Then, you need to take care of the routing.
match 'admin/login' => 'admin#login'
Rails favours convention over configuration, so it means that controllers are ALWAYS using plural, table names also, whereas models are always using singular, with an uppercase at the beginning.
I would strongly advice you to stick to these conventions, that's best practice and in the foundation of the Rails framework