sir-dunxalot / ember-easy-form-extensions

Manages form submission in the controller/component and route layers of Ember apps
MIT License
28 stars 14 forks source link

Cannot set property 'formForModelPath' of undefined #9

Closed tspacek closed 9 years ago

tspacek commented 9 years ago

Using Ember 1.10, handlebars 2.0.0 and ember-cli-htmlbars 0.7.4 I get:

TypeError: Cannot set property 'formForModelPath' of undefined

From

Ember.Handlebars.registerHelper('form-for', function(object, options) {
  options.data.keywords.formForModelPath = object;
  return EasyFormShims.viewHelper(this, Ember.EasyForm.Form, options);
});

When I do

  {{#form-for model}}
  {{/form-for}}

This suggests it's a HTMLBars issue: https://github.com/ef4/liquid-fire/issues/113

sir-dunxalot commented 9 years ago

Hi Tom,

Thanks for opening the issue. This addon doesn't map easy form's capabilities 1-to-1. {{#form-for}} has been replaced by the {{#form-wrapper}} component. The reasoning for this was the unnecessary layer {{form-for}} adds to forms and the ease at which one can just do {{input someModel.property}}. Thus, I didn't update theform-for` helper.

I'd be open to a conversation about the benefits of adding it back but we'd have to figure out the role of form-wrapper vs form-for and all that.

What are the typical use cases you use the model argument of form-for for?

tspacek commented 9 years ago

Thanks, on further thought I didn't need form-for in a lot of cases, and form-wrapper works where I do.

On Sun, Mar 8, 2015 at 4:40 AM, Duncan Walker notifications@github.com wrote:

Hi Tom,

Thanks for opening the issue. This addon doesn't map easy form's capabilities 1-to-1. {{#form-for}} has been replaced by the {{#form-wrapper}} component. The reasoning for this was the unnecessary layer {{form-for}} adds to forms and the ease at which one can just do {{input someModel.property}}. Thus, I didn't update theform-for` helper.

I'd be open to a conversation about the benefits of adding it back but we'd have to figure out the role of form-wrapper vs form-for and all that.

What are the typical use cases you use the model argument of form-for for?

— Reply to this email directly or view it on GitHub https://github.com/sir-dunxalot/ember-easy-form-extensions/issues/9#issuecomment-77700198 .

sir-dunxalot commented 9 years ago

Ok, sounds good. Well if you change your mind feel free to reopen the issue and we can discuss further.