1

I would like to use a twitter bootstrap layout in my Ember.js driven Rails Application.

I am wondering if anyone knows a good way to integrate the generated application.html.erb layout and the ember.js, application.handlebars layout?

1 Answer 1

1

Here's a JSFiddle (based on tomdale's excellent ember-guides screencast) that shows ember.js + twitter bootstrap.

By default ember will render into the body tag. As long as your application.html.erb loads your ember app plus bootstrap and the required libraries there is no need to make any changes. Then just use bootstrap classes in your handlebars templates. For example:

<script type="text/x-handlebars">
<div class="navbar">
  <div class="navbar-inner">
    <a class="brand" href="#">Bloggr</a>
    <ul class="nav">
      <li>{{#linkTo 'posts'}}Posts{{/linkTo}}</li>
      <li>{{#linkTo 'about'}}About{{/linkTo}}</li>
    </ul>
  </div>
</div>
{{outlet}}
</script>
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the response. The fiddle and the preview for Peepcode helped, but as always with most new frameworks/languages just slowing down and reading the guides on Ember.js were most powerful. As far as editing the application.html.erb file from "rails g bootstrap:layout application fixed" to work with application.hbs, nope. Just build the tags you want yourself in you .hbs templates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.