i want to create a “messenger” and i have those models:
- Account
- Message
- Message channel
Account has many channels, Channel has many messages, message belongs to account(sender)
Also – there is an access restrictions to control which users can read/write to channel
Question is – how to create beautiful routes(and controller methods) to manage theese models..
Sorry for my bad english.(
You should use nested ressourcs! In
config/routes.rbThis will automaticly generate RESTfull URLs but you have to update all the views because of the changed _path methods. You can view the paths by calling
rake routes.