简体   繁体   中英

Error with Ember.js + Rails - undefined 'Ember.Router.extend'

I tried zillion tutorials about Rails backend and Ember.js and each time I'm getting an error:

TypeError: 'undefined' is not an object (evaluating 'Ember.Router.extend')

Does anyone have working code with Rails 3.2 and ember-rails gem which shows correct routing?

ps I've got this error even with default routing generated by ember-rails command:

rails g ember:bootstrap

ps2. Yes, I've got jQuery - other functions work properly, only Ember.Router not.

If you haven't gotten very far in programming your app try giving these scripts a try:

run rails new app_name -m http://emberjs.com/template.rb

Add config.ember.variant = :development into config/application.rb

run rails g ember:install --head

Now you should a have a working rails app with ember and ember-data included and embers MVC structure under assets/javascripts.

Cheers!

Ps Don't forget to download handlebars and update the store.js file to the most current revision (10 as of this post)

Also, go for coffeescript. It's much more readable unless you're a diehard braces fan.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM