jwhitley/requirejs-rails — Issue #23: Require / Underscore / Backbone
Author: zerocool313
Created: 2012-01-06 20:14:09+00:00
State: open

I'm a newbie, so I may have this wrong... please forgive me if that's the case. I am getting an error trying to require "underscore" and "backbone" using this gem.

The error I'm receiving (when i require ['jquery','underscore','backbone']) is the following:
f is undefined
[Break On This Error] this._escapedAttributes={};this.cid=f....tes[a])return b;b=this.attributes[a];
backbone.js (line 8)

* I've added "gem 'requirejs-rails'" to my projects Gemfile.

* I've run "bundle install" "rake db:migrate"... not sure if both are required?

* I removed all Sprockets directives from application.js as directed.

* In application.html.erb I replaced with "<%= requirejs_include_tag "application" %>"

* Added scripts as follows:

app/assets/javascripts/
- application.js

vender/assets/javascripts/
- backbone.js
- underscore.js
- jquery-1.7.1.min.js

* application.js has the following code:
require(['jquery', 'underscore', 'backbone'], function($, _, Backbone) {
console.log('app init');
});

Any help is much appreciated!!

-Greg