I have one resource that is only a model: I am building a an app which has a similar thing to the Twitter timeline and mentions system. The mentions class has not a correspondent controller or any views. The way I built it, mentions are created whenever a message is posted. Before the message being created, it is scanned for usernames and creates a mention instance for each one of them. This happens all in the messages and mentions models.
Or is this model-only situation fine for those resources with which users dont interact directly?
This is my first rails app, and I am still learning MVC and REST, so I guess I am doing a lot of things wrong. What would be a proper architecture for this?
If you have data that doesn’t need a separate controller or view, then that’s just the way your app is.
That said, it’s often handy to expose even nested models via a RESTful mapping (if you app requires it) to avoid over-eager fetching–but again, whether or not that makes sense is app-specific.