3

From a rails .erb I can call an Emberjs view and it renders fine:

<script type="text/x-handlebars">
  {{ view App.ListUsers }}
</script>

Now if I were to use the core statemanager, I'd make something like this:

App.Router = Ember.Router.extend({
    index: Ember.State.extend({
      route: '/'
});

How might I call the the index route directly from a .erb? Like a bootstrap to start the emberjs app.

I'm looking to use Ember for an administration dashboard so I will fire up the emberjs app after an admin logs into the rails app.

sly7_7
  • 11,961
  • 3
  • 40
  • 54
holtkampw
  • 367
  • 1
  • 13

1 Answers1

0

Have you tried:

Ember.Router.extend({
  root: Ember.Route.extend({
    index: Ember.Route.extend({
      route: '/'
      // connectOutlets and such...
    })
  }),

From the Ember.Router dochttp://emberjs.com/api/classes/Ember.Router.html:

The initialState property of Ember.Router instances is named root.

midu
  • 1,589
  • 1
  • 9
  • 14
  • Good call, but that doesn't completely answer my question. If I have a rails view, how do I tie the rails view with that specific route in erb. Is there a call I can use in handlebars to call that route without user interaction? – holtkampw Oct 03 '12 at 18:18