Closed marcelastrapi closed 12 months ago
Didn't test it, but maybe use regex *
or something close to it..
Router.route("/projects/:projectPath*", ... ){}
Router.route("/projects/:projectPath+", ... ){}
Router.route("/projects/:projectPath(.*)", ... ){}
Hello community, I've got a problem but this is not an issue from iron-router, maybe I'm not in the good place to post this... My problem is: I make a website for a musician friend, he can create project, I have a page where all the projects are, and if you click on a project inside this page, iron router make the client go on the project page (inside the site). The problem is that he's got projects with the '/' inside the name now. So iron:router can't understand what I mean.
The problem could have gone easy if I knew that before, because instead of the projectName I could just go withthe id, and I would'nt have any problem. but can't do this now, all the database is working with projectNames... So I just want to change the project page path to a safer name like (projectName.replace(/\//g,"+")) but keep the projectName for subscriptions.
I try to pass multiple arguments to Router.go, in the purpose of having the both data I need:
Router.go("project", { projectName:this.name, projectPath: this.name.replace(/\//g,"+") });
But inside the route, the route only knows the params write after the ':'. So if I wrote:Router.route("/projects/:projectPath", ....
He doesn't know anymore the projectName. I hope I'm understandable....Thanks for your help !