How to peform crud operations in same route


#1

I need to do create edit and delete operations in same route.

I am using two modal dialogues one is for create and one is for edit.


#2

If we assume a post model create must be on the posts route. edit and delete can be created on the posts route as 2 buttons per row but are normally created on the post route.

See:


#3

but i need to create create and edit on same route. any idea plzzz???


#4

On each row in your #each loop write something like this:

<button {{action 'edit' post}} class="btn btn-default">Edit</button>

You can than show the edit component.


#5

but how to fetch records from saved data in edit fields, so that i can edit it and save back.

I need solution for how i can bind previously saved data to edit window for each record.