简体   繁体   中英

ember.js and rails layouts

I'm integrating ember to my rails application. So the problem I've found is - ember compile template and then append it to the body.

rails template:

 %body
#main-content
  = render 'layouts/header'
  .container.main
    #content
      = yield :dashboard

      #EMBER template
      %script{type:'text/x-handlebars'}
       {{view Ember.TextField valueBinding="newEnrtyName"}}
       {{newEnrtyName}}

    - if has_left_menu?
      #navigation.l= render 'layouts/left-menu'
  = render 'layouts/footer'

Template append after footer :(

So is it possible tell ember work with only the part of page?

You can set the rootElement property on the application, eg.:

App = Ember.Application.create({
  rootElement: '#ember-app-container'
});

You have to have this element existing in your HTML template.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM