I have a Reports controller and two types of users: companies and customers. Each sees dramatically different pages when they go to view their main ‘Reports’ page (i.e. what I would usually call the index).
Because these pages are different but are each respective user’s main window on reports, what is the best way to organize these in a RESTful way?
So far I have been doing something like index (for companies) and custindex (for customers). Is there a better way?
Note: these pages have more than a couple of simple differences – otherwise some simple if or case statements based on user type would have sufficed.
I would avoid touching the controller and do it in the view with partials:
Now you just need a “_customer.html.erb” and a “_company.html.erb” partial in that folder.