vendredi 1 juillet 2016

Putting an Ember partial inside Rails view

I have an application in Rails. Recently Ember was installed, and is being used on the part of the views. It works fine there. Now, I need to add some ember functionality to the navbar. At the moment navbar is the part of the Rails layout. I've never dealt with ember before, I've only read some tutorials.

The first solution I've found so far is rewriting and moving the navbar from Rails layout to Embers layout. But that seems like a lot of work, and I'm not sure if it is a good idea.

There is also a way, of puting a div named, for example, "ember-app" and root the Ember there. But that works for a whole ember app, and I want only a part in navbar, and something else in the body. Essentially, what I would like to do, is something like this

<body>
  <div class="navbar">
     *rails things*
      <div id="ember-navbar-part></div>
      *more rails things*
  </div>
  <div id="ember-body-part">
  </div>
</body>

Is it possible? There are some ember partials things I've found, but they work inside embers app. Maybe moving the navbar into embers app is normal things?




Aucun commentaire:

Enregistrer un commentaire