Good strategy for "dashboard" ?

11 views
Skip to first unread message

fugee ohu

unread,
May 3, 2018, 10:06:16 AM5/3/18
to Ruby on Rails: Talk
I'm working on an auctions site My app doesn't yet have a user dashboard so I'm thinking app/views/user/dashboard or app/views/user/admin and same thing for controllers would be named dashboard_controller or admin_controller Is that good convention I was thinking there's probably gems too I know this isn't  a rails question but this is a big step in designing my site I'd like to get it right the first time Previously on other sites, I used the above described strategy

Marco Antonio Almeida

unread,
May 3, 2018, 10:45:19 AM5/3/18
to rubyonra...@googlegroups.com
Hi,

If your application is pure Rails, I would advise doing the approach you already mentioned, just a DashboardController with an index/show action would suffice. However, I think that the pure MVC architecture is usually not good enough when developing dashboards. The more components you have in the screen, the more resources you will have to handle in your controller which can compromise the controller's readability. 

So, I would either look into adding a design pattern such as presenters or view objects. Otherwise, you can use JavaScript in the frontend to access the various endpoints in the form of controller actions to render specific components of the dashboard. The last option is the best IMHO, because you are going to maintain your application as closer to the MVC as possible (no addition of design patterns), however, it is also important to have some JavaScript knowledge to keep your front end sound.

Hope it helps.

/ Marco

On Thu, May 3, 2018 at 4:06 PM fugee ohu <fuge...@gmail.com> wrote:
I'm working on an auctions site My app doesn't yet have a user dashboard so I'm thinking app/views/user/dashboard or app/views/user/admin and same thing for controllers would be named dashboard_controller or admin_controller Is that good convention I was thinking there's probably gems too I know this isn't  a rails question but this is a big step in designing my site I'd like to get it right the first time Previously on other sites, I used the above described strategy

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/568a9ef8-b7ad-411c-a784-4a00879d3610%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages