title: Region Undefined in Backbone Layout
body: <p>I'm having a major issue with Backbone Marionette that I just can't seem to figure out. Maybe my man Derick Bailey can help me out.
  What I'm doing is simple, at least one would think.
  I have a layout (please ignore the improper coffee indenting for now).</p>
  
  <pre><code>class SearchLayout extends Backbone.Marionette.Layout
  
  # template: _.template SearchResultsTemplate
  template: Handlebars.compile SearchResultsTemplate
  tagName: "section"
  className: "search-layout"
  
  ui:
    "searchInput":  ".search-input"
    "saveTopic":    ".save-this-topic"
  
  regions:
    resourcesRegion: ".resources-content"
  </code></pre>
  
  <p>And later on I bind to a model that's tied to this layout, a <code>@searchResults</code> model.</p>
  
  <pre><code>initialize: -&gt;
    @model.on "change:query", @setClasses, @
    @model.on "change:query", @setResource, @
  
  onRender: -&gt;
    # app.vent.trigger "view:rendered"
    setTimeout =&gt;
      @setClasses()
      @globalBindings()
      @handlebarsHelpers()
      @bindUIElements()
    , 50
  
  handlebarsHelpers: -&gt;
    # helpers specific to this view.
  
  globalBindings: -&gt;
    # @model.on "change:query", @setResource, @
  
  setResource: -&gt;
  
    @resources = new ResourcesCollection()
    @resources.fetch
      async: false
      success: =&gt;
        @view = new ResourcesViews.collectionView
          collection: @resources
        @resourcesRegion.show @view
  </code></pre>
  
  <p>I tried at first to bind to my resources with <code>.on</code> but that wasn't working well, so I decided to go with a success on fetch as shown here.</p>
  
  <p>The strange thing is I had it working great, and it even renders (sometimes) the first time, but after I make any changes to my search model, I get this error:</p>
  
  <pre><code>Uncaught TypeError: Cannot call method 'show' of undefined 
  </code></pre>
  
  <p>Here are my views:</p>
  
  <pre><code>define [
    "backbone.marionette"
    "jquery"
    "underscore"
    "backbone"
    "text!templates/resources/resource.html"
  ], (Marionette, $, _, Backbone, ResourceViewTemplate) -&gt;
    class ResourceView extends Marionette.ItemView
  
      className: "js-resource js-resource-view col-md-6"
      tagName: "div"
      template: Handlebars.compile ResourceViewTemplate
  
      initialize: -&gt;
  
      onBeforeRender: -&gt;
  
      onRender: -&gt;
  
    class ResourcesEmptyView extends Marionette.ItemView
  
      className: "js-resource-not-found not-found js-resource-view col-md-12"
      tagName: "section"
      template: "&lt;h3&gt;Sorry, nothing found for that search. Try another.&lt;/h3&gt;"
  
      initialize: -&gt;
  
      onBeforeRender: -&gt;
  
      onRender: -&gt;
  
    class ResourcesCollectionView extends Marionette.CollectionView
  
      className: "js-resources js-resources-view list-unstyled"
      tagName: "ul"
      emptyView: ResourcesEmptyView
      itemView: ResourceView
  
      initialize: -&gt;
  
      onBeforeRender: -&gt;
  
      onRender: -&gt;
  
    exports =
      collectionView: ResourcesCollectionView
      individualView: ResourceView
  </code></pre>
  
  <p>The strange thing is, my <code>@view.render().el</code> is actually defined and working great! It will even append to the <code>$('body')</code> with no problem.</p>