Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4836

Best practice to implement add/update forms?

$
0
0

@hschillig wrote:

I'm trying to avoid duplication in my code. In some frameworks, you can implement a model into the form tag and it'll populate the inputs accordingly. How do you do this in Ember so you don't have to duplicate a large form twice (once for the add screen and second for the updating/editing screen). I'm trying to do something like this:

{{render "forms/contract" contract}}

The above code will be for the edit and the new code will be similar to: {{render "forms/contract"}}. In the forms/contract.hbs file, I have inputs like: {{input value=fname}} but the editing screen won't populate with contract.fname unless I physically type that out which I don't want for my add screen.

Thanks for any input.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4836

Trending Articles