meleyal / backbone-on-rails

A simple gem for using Backbone.js with Rails.
MIT License
810 stars 126 forks source link

Problems getting eco templates working #38

Closed andrewhavens closed 11 years ago

andrewhavens commented 11 years ago

I'm new to Backbone.js as well as your gem, so forgive me if this is a stupid question. I'm following through the Railscast on using backbone-on-rails, but can't seem to get the eco templates to render. And I don't see any eco library being downloaded in the browser. Is this supposed to be required somewhere? I noticed the gem is added as a dependency but there weren't any instructions in the readme about needing to set it up.

class MyApp.Views.PagesIndex extends Backbone.View

  template: JST['pages/index']

    render: ->
        $(@el).html(@template(herevar: 'variable goes here'))
        this
andrewhavens commented 11 years ago

Ah! Answered my own question while copy/pasting the code. Coffeescript is picky about the type of white space you use. You have to be consistent. I was mixing spaces and tabs. Now that the spacing is consistent it all works.