John
John

Reputation: 13705

Emberjs - You cannot provide a template block if you also specified a templateName

I am working on the Ember Auth Rails Demo and after the Model UI chapter am getting this error:

You cannot provide a template block if you also specified a templateName

I don't know where this is coming from and do not see anywhere that I am specifying both a template block and a templateName (as indicated in this question). Any idea on where this might be arising? I was thinking perhaps somewhere in the views directory, perhaps in auth.js.coffee, which looks like this:

Planbug.AuthView = Em.View.extend
  templateName: 'auth'

Or perhaps in views/auth/sign-in.js.coffee, which looks like this:

Planbug.AuthSignInView = Em.View.extend
  templateName: 'auth/sign-in'

  email: null
  password: null

  submit: (event, view) ->
    event.preventDefault()
    event.stopPropagation()
    Planbug.Auth.signIn
      data:
        email:    @get 'email'
        password: @get 'password'

I am trying to follow the demo closely but I might have a typo somewhere or maybe am doing something slightly different. Any idea on where to look for conflict?

Upvotes: 2

Views: 886

Answers (1)

Bradley Priest
Bradley Priest

Reputation: 7458

Are you calling either of these views using the handlebars view helper.

This error would be thrown if you call the block version of view

{{#view Planbug.AuthView}}
  Something 
{{/view}}` 

instead of the non-block version

{{view Planbug.AuthView}}

Upvotes: 1

Related Questions