Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9071461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:55:14+00:00 2026-06-16T17:55:14+00:00

I’m building a front-end (on top of Ruby on Rails) using ember.js and the

  • 0

I’m building a front-end (on top of Ruby on Rails) using ember.js and the ember-rails gem.

My (ember) application consists of Models, Views, Controllers and an application.handlebars template which describes my UI.

Whats the best practice to break up this application.handlebars file so that I can manage the UI? For example, I’d like to have Navigation at the top of the page.

I’ve tried using the Ember.Router, a separate navigation.handlebars (with NavigationView and NavigationController) the {{outlet}} helper to no avail. Here’s what the Router looks like:

App.Router = Ember.Router.extend(
  enableLogging:  true
  root: Ember.Route.extend(
    index:
      route: '/'
      connectOutlets: (router, context) =>
        router.get('applicationController').connectOutlet('navigation')
)

and the application.handlebars

<h1>Lots of HTML that I want to break up</h1>
{{outlet}}

Let me know if you need more info…thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T17:55:16+00:00Added an answer on June 16, 2026 at 5:55 pm

    As per my Understanding, Let’s suppose you want 3 sections(can be any number) Header, Content & Footer, You can do something as follows

    <script type="text/x-handlebars" data-template-name="application">
      {{view MyApp.HeaderView}}
      {{#view MyApp.ContentView}}
        {{outlet}}
      {{/view}}
      {{view MyApp.FooterView}}
    </script>
    
    <script type="text/x-handlebars" data-template-name="app-header">
      All your Header related HTML
    </script>
    
    <script type="text/x-handlebars" data-template-name="app-content">
      HTML related to content
      {{yield}} //this will be explained at the end
      More HTML if you want
    </script>
    
    <script type="text/x-handlebars" data-template-name="app-footer">
      HTML related to footer
    </script>
    
    MyApp.HeaderView = Ember.View.extend({
      templateName: 'app-header'
    })
    
    
    MyApp.ContentView = Ember.View.extend({
      templateName: 'app-content'
    })
    
    MyApp.FooterView = Ember.View.extend({
      templateName: 'app-footer'
    })
    
    MyApp.ApplicationView = Ember.View.extend({
      templateName: 'application'
    })
    

    explaining {{yield}} In a nutshell, whatever is between in the block helper of a given view goes in there, In the above example for the MyApp.ContentView, the {{outlet}} defined in the {{#view MyApp.ContentView}} handlebars gets inserted at the {{yield}}

    On the similar lines let me show the difference between layoutName property & templateName property,

    App.someView = Ember.View.extend({
      tagName: 'a',
      templateName: 'a-template',
      layoutName: 'a-container'
    })
    
    <script type="text/x-handlebars" data-template-name="a-template">
      Hi There
    </script>
    
    <script type="text/x-handlebars" data-template-name="a-container">
      <span class="container">
        {{yield}}
      </span>
    </script>
    

    Will result in following HTML

      <a class="ember-view" id="ember235">
        <span class="container ember-view" id="ember234">
          Hi There
        </span>
      </a>
    

    Use these concepts to split the application handlebars in your case it would be something like

    {{view App.NavigationView}}
    {{outlet}}
    

    Update as per latest ember

    The new ember supports partials similar to rails, now we can modify the above to use {{partial}} as follows:

    {{partial "header"}}
    {{outlet}}
    {{partial "footer"}}
    

    Ember when encountered this template will look for the template whose name is _header(similar to rails) and inserts the template(same goes for footer)

    And If want to associate a controller we can use {{render}} helper

    {{render "sidebar"}}
    

    inserts the template whose name is sidebar at specified location in handlebars besides it also associates App.SidebarController to it,

    Note: we cannot use {{render 'sidebar'}} more than once in same handlebars file.

    But again if you want to use a widget like view multiple places in a given page then use {{view}} helper

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using JSon response to parse title,date content and thumbnail images and place
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.