There are users, there are projects, users work with several projects.
How to organize a menu with links like this?
http: // localhost: 3000 / projects / 100 / settings
where 100 is the project number, the project has changed, the project id has changed in the menu. The path looks like this:
Router.route('/projects/:idProject/settings/', { name: 'settings' }); the link in the menu itself then looks like this
<a href="{{pathFor 'settings' idProject = idProject}}"> Настройки </a> And the plugging happens in my misunderstanding how to get idProject correctly, where to store it?
I tried to shove in the Session, everything is cool, but when the page is reloaded, the Session flies, now the interceptor is installed: if there is no data about the project in the session, then transfer it to the project selection page, select the project, put its number into the session.
But this path is very sad in my opinion, what alternatives can there be that
- the user entered into the browser without data in the session http: // localhost: 3000 / projects / 01 / settings and transferred it to the necessary page
- links in the menu were formed correctly
I thought that in Router it is possible to catch the project id through this.params and register it in the Session if there is no data there, but something confuses in this approach.