Now the app is working better. I can create and edit types by user.

Before you could not see the changes made.

See the commit

Line 7 to 8:
Matches a id parameter.

Line 10:
When you do post to the param type you do the following:

Update your type with the attributes category and name (this attributes are defined in the model type) Then redirect to the principal page: types.

Line 20:
When a types param is present on post: Create a type with the attributes category and name and the user id is always present. Then redirect to the main page.

create_edit_types1


Here I define the form action, Iā€™m specifying the user id on the path.

create_edit_types2

create_edit_types3

Now I can edit and create Types.