How do I structure a view with a shared sidebar?

I have an application that has a sidebar shown across all views across all controllers. This sidebar requires a set of assigns, for example a list of starred shortcuts which the user can then use to quickly jump to their favorite dashboards.

Right now, in each controller’s (I’m still early in development) actions, I have the starred shortcuts set in the assigns. This seems like a lot of extra work.

What is the best way to factor out the part of the sidebar that needs certain assigns set in every action?

Thank you for your help.

You can try using a plug that preloads the needed data before you hit the controller. Similar to what you would do if you had a current_user, for example.

Thank you.