github.com/segakazzz/buffalo@v0.16.22-0.20210119082501-1f52048d3feb/genny/resource/templates/standard/actions/resource-name.go.tmpl (about)

     1  package actions
     2  
     3  import (
     4    "net/http"
     5  
     6    "github.com/gobuffalo/buffalo"
     7  )
     8  
     9  type {{.opts.Name.Resource}}Resource struct{
    10    buffalo.Resource
    11  }
    12  
    13  {{ range $a := .actions }}
    14  // {{$a.Pascalize}} default implementation.
    15  func (v {{$.opts.Name.Resource}}Resource) {{$a.Pascalize}}(c buffalo.Context) error {
    16    return c.Render(http.StatusOK, r.String("{{$.opts.Model.Proper}}#{{$a.Pascalize}}"))
    17  }
    18  
    19  {{end}}