I'm using rails 4 with:
gem 'ember-rails'
gem 'ember-source', '2.0'
ember-rails
is at version 0.19 in my Gemfile.lock
. I'm very new to ember (and javascript frameworks in general) and I'm following this tutorial . It was written in April 2014 so I think it might be out of date but it's the most recent guide to ember-rails with rails 4 that I can find.
Most of the setup was generated by running rails generate ember:bootstrap
and application.js.coffee
looks like this:
#= require jquery
#= require jquery_ujs
#= require ember
#= require ember-data
#= require active-model-adapter
#= require_self
#= require api
# for more details see: http://emberjs.com/guides/application/
window.Api = Ember.Application.create()
Also api.js.coffee looks like this:
#= require_tree ./adapters
#= require_tree ./mixins
#= require_tree ./models
#= require_tree ./controllers
#= require_tree ./views
#= require_tree ./helpers
#= require_tree ./components
#= require_tree ./templates
#= require_tree ./routes
#= require ./router
#= require_self
My problem is that when I click on the ember inspector in Chrome's developer tools, I get the 'Ember application not detected' message. The two coffeescript files I referenced above are the only two files the tutorial has talked about so far so I think the error might be with one of them. If you need more information please let me know. When I run the rails server then try to access the Ember Inspector this is what I see in the console:
DEBUG: -------------------------------
DEBUG: Ember : 2.0.0
DEBUG: Ember Data : 2.1.0
DEBUG: jQuery : 1.11.3
DEBUG: -------------------------------
Uncaught TypeError: this.validateFullName is not a function
Ember Inspector Active
It appears you don't have a template defined for ember to render.
By default it looks at the application template. From the tutorial I pointed out above. Once you get that implemented you should be able to see the ember inspector.
// app/assets/javascripts/templates/application.js.emblem
h1 Hello World
outlet
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.