// List gets all Activities. This function is mapped to the path
// GET /activities
List gets all Activities. This function is mapped to the path
GET /activities
// List gets all Activities . This function is mapped to the path // GET / activities
func (v ActivitiesResource) List(c buffalo.Context) error {
	q := v.scope(c).PaginateFromParams(c.Params())
	activities := &models.Activities{}
	if err := q.All(activities); err != nil {
		return err
	}
	return responder.Wants("html", func(c buffalo.Context) error {
		c.Set("pagination", q.Paginator)
		c.Set("activities", activities)
		return c.Render(http.StatusOK, r.HTML("/activities/index.plush.html"))
	}).Wants("json", func(c buffalo.Context) error {
		return c.Render(200, r.JSON(activities))
	}).Wants("xml", func(c buffalo.Context) error {
		return c.Render(200, r.XML(activities))
	}).Respond(c)
}
func ( v ActivitiesResource ) List ( c buffalo . Context ) error { q := v . scope ( c ) . PaginateFromParams ( c . Params ( ) ) activities := & models . Activities { } if err := q . All ( activities ) ; err != nil { return err } return responder . Wants ( " " , func ( c buffalo . Context ) error { c . Set ( " " , q . Paginator ) c . Set ( " " , activities ) return c . Render ( http . StatusOK , r . HTML ( " " ) ) } ) . Wants ( " " , func ( c buffalo . Context ) error { return c . Render ( 200 , r . JSON ( activities ) ) } ) . Wants ( " " , func ( c buffalo . Context ) error { return c . Render ( 200 , r . XML ( activities ) ) } ) . Respond ( c ) }
List gets all Activities.
List gets all Activities .
// Paginate results. Params "page" and "per_page" control pagination. // Default values are "page=1" and "per_page=20". // Retrieve all Activities from the DB // Add the paginator to the context so it can be used in the template.