Ember.js with Rails4: Browser Alarm Reset Application

EDIT: The problem is resolved. Removing turbolinks is all you need to do.

When using the Rails4 application , use ember-rails 0.13.0 , we have a problem with the back button not working. Each time, returning to the previous route using the "Back" button, the application encounters such errors:

in Firefox 24.0a2:

TypeError: Class.PrototypeMixin.applyPartial is not a function @ http://localhost:3000/assets/ember.js?body=1:11933 

on Chrome 28:

 Uncaught Error: jquery-ujs has already been loaded! jquery.js?body=1:517I DEBUG: ------------------------------- ember.js?body=1:364 DEBUG: Ember.VERSION : 1.0.0-rc.6.1 ember.js?body=1:364 DEBUG: Handlebars.VERSION : 1.0.0 ember.js?body=1:364 DEBUG: jQuery.VERSION : 1.10.2 ember.js?body=1:364 DEBUG: ------------------------------- 

It seems that the entire application stack is loaded again, which ends with a non-functional code base. In any case, the same application works fine with Rails3 .

Messages from other people having problems with ember.js along with turbolinks :

 Cannot perform operations on a Metamorph that is not in the DOM 
+7
ruby-on-rails-4 turbolinks ember-rails
source share
1 answer

After some debugging, we noticed that these are turbolinks problems. Using backbutton caused turbolinks , which caused strange effects with the ember.js application, like reloading all javascripts and thus overriding the state of the application.

Removing turbolinks completed the task. Here is a useful link on how to do this: http://blog.steveklabnik.com/posts/2013-06-25-removing-turbolinks-from-rails-4

+7
source share

All Articles