func (v EventsResource) New(c buffalo.Context) error {
	return c.Render(200, r.Auto(c, &models.Event{}))
}
New renders the form for creating a new Event.
This function is mapped to the path GET /events/new
package actions
import (
	"github.com/devrelcollective/xela/models"
	"github.com/gobuffalo/buffalo"
	"github.com/gobuffalo/pop"
	"github.com/pkg/errors"
)
type EventsResource struct {
	buffalo.Resource
}
func (v EventsResource) List(c buffalo.Context) error {
	tx, ok := c.Value("tx").(*pop.Connection)
	if !ok {
		return errors.WithStack(errors.New("no transaction found"))
	}
	events := &models.Events{}
	q := tx.PaginateFromParams(c.Params())
	if err := q.All(events); err != nil {
		return errors.WithStack(err)
	}
	c.Set("pagination", q.Paginator)
	return c.Render(200, r.Auto(c, events))
}
func (v EventsResource) Show(c buffalo.Context) error {
	tx, ok := c.Value("tx").(*pop.Connection)
	if !ok {
		return errors.WithStack(errors.New("no transaction found"))
	}
	event := &models.Event{}
	if err := tx.Find(event, c.Param("event_id")); err != nil {
		return c.Error(404, err)
	}
	return c.Render(200, r.Auto(c, event))
}