bjkpriyanka
bjkpriyanka

Reputation: 151

How to create a route with a dynamic value in ember

I am new to ember. If u find my question silly please dont mind.

I have a route '/lobby' which shows a different options.

when user chooses one particular option i want to create route /lobby/option_choosen(this will be the value which user chosen).

How to create route in ember in this scenario.

Upvotes: 0

Views: 173

Answers (1)

Ember Freak
Ember Freak

Reputation: 12872

Please read ember guide dynamic segment part for defining routes. and for model preparing you can read dynamic model .

In router.js,

Router.map(function() {
  this.route('lobbies');
  this.route('lobby', { path: '/lobby/:lobby_id' });
});

Upvotes: 1

Related Questions