Skip to content Skip to sidebar Skip to footer

Ember 2, Model.save() From Component My-modal.hbs

I have this posts.hbs: {{#each model as |post|}}

{{post.title}}

{{post.text}}

Solution 1:

You are sending "POST" record as an argument

{{#each model as |post|}}
    <a href="#" {{action 'openWriteModal'"----post----"}}>  

      <h3>{{post.title}}</h3>
          {{post.text}}
          {{post.author.name}}
    </a>
{{/each}}

This is an ember record. And then you're trying to find the exact same POST

Instead of using (u need to specify "directory/model_name" not DS record instance)

 model: this.store.findRecord('post', post.id, { reload: true }), 

Use

returnthis.render('modal', {
    outlet: 'modal',
    into: 'application',
    model: post
    controller: 'application'
  });

Not sure if this helps your problem, let me know.

Post a Comment for "Ember 2, Model.save() From Component My-modal.hbs"