You're right that this is more a RESTful dilemma and not related to any specific framework. It depends on the role of the Parent and Child Models and whether the dashboard 'exposes' any other additional resources. For the sake of simplicity I'm going the pretend the parent model is an Author and the child model is a Book.
If the dashboard only contains a collection of children related to a parent model you could consider using Nested Resources. E.g URLs similar to /authors/{author_id}/books
(and alias to /dashboard
if required):
# routes.rb
resources :authors do
resources :books
end
The logic then belongs in the BooksController
:
class BooksController < ApplicationController
def index
if params[:author_id]
@author = Author.find(params[:author_id])
@books = @author.books
return render '/books/author_index'
else
# Code for simple top level RESTful resource. E.g '/books'
# ...
@books = Book.all
return render 'index'
end
end
end
However if your dashboard is more broad and touches multiple domains, you could consider the dashboard as a resource in itself (e.g it's own DashboardController
) as described in this answer.