// Show gets the data for one Contact. This function is mapped to
// the path GET /contacts/{contact_id}
Show gets the data for one Contact. This function is mapped to
the path GET /contacts/{contact_id}
// Show gets the data for one Contact . This function is mapped to // the path GET / contacts / { contact_id }
func (v ContactsResource) Show(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/show.html"))
}
func ( v ContactsResource ) Show ( 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 ( " " ) ) }
Show gets the data for one Contact.
Show gets the data for one Contact .
// Get the DB connection from the context // Allocate an empty Contact // To find the Contact the parameter contact_id is used. // Make contact available inside the html template