// Edit renders a edit form for a Contact. This function is
// mapped to the path GET /contacts/{contact_id}/edit
Edit renders a edit form for a Contact. This function is
mapped to the path GET /contacts/{contact_id}/edit
// Edit renders a edit form for a Contact . This function is // mapped to the path GET / contacts / { contact_id } / edit
func (v ContactsResource) Edit(c buffalo.Context) error {
	tx := c.Value("tx").(*pop.Connection)
	contact := &models.Contact{}
	if err := tx.Find(contact, c.Param("contact_id")); err != nil {
		return c.Error(404, err)
	}
	c.Set("contact", contact)
	return c.Render(200, render.R.HTML("contacts/edit.html"))
}
func ( v ContactsResource ) Edit ( c buffalo . Context ) error { tx := c . Value ( " " ) . ( * pop . Connection ) contact := & models . Contact { } if err := tx . Find ( contact , c . Param ( " " ) ) ; err != nil { return c . Error ( 404 , err ) } c . Set ( " " , contact ) return c . Render ( 200 , render . R . HTML ( " " ) ) }
Edit renders a edit form for a Contact.
Edit renders a edit form for a Contact .
// Get the DB connection from the context // Allocate an empty Contact // Make contact available inside the html template