// Show gets the data for one Activity. This function is mapped to
// the path GET /activities/{activity_id}
Show gets the data for one Activity. This function is mapped to
the path GET /activities/{activity_id}
// Show gets the data for one Activity . This function is mapped to // the path GET / activities / { activity_id }
func (v ActivitiesResource) Show(c buffalo.Context) error {
	activity := &models.Activity{}
	if err := v.scope(c).Find(activity, c.Param("activity_id")); err != nil {
		return c.Error(http.StatusNotFound, err)
	}
	return responder.Wants("html", func(c buffalo.Context) error {
		c.Set("activity", activity)
		return c.Render(http.StatusOK, r.HTML("/activities/show.plush.html"))
	}).Wants("json", func(c buffalo.Context) error {
		return c.Render(200, r.JSON(activity))
	}).Wants("xml", func(c buffalo.Context) error {
		return c.Render(200, r.XML(activity))
	}).Respond(c)
}
func ( v ActivitiesResource ) Show ( c buffalo . Context ) error { activity := & models . Activity { } if err := v . scope ( c ) . Find ( activity , c . Param ( " " ) ) ; err != nil { return c . Error ( http . StatusNotFound , err ) } return responder . Wants ( " " , func ( c buffalo . Context ) error { c . Set ( " " , activity ) return c . Render ( http . StatusOK , r . HTML ( " " ) ) } ) . Wants ( " " , func ( c buffalo . Context ) error { return c . Render ( 200 , r . JSON ( activity ) ) } ) . Wants ( " " , func ( c buffalo . Context ) error { return c . Render ( 200 , r . XML ( activity ) ) } ) . Respond ( c ) }
Show gets the data for one Activity.
Show gets the data for one Activity .
// Allocate an empty Activity // To find the Activity the parameter activity_id is used.