github.com/JarrahG/buffalocli@v0.0.0-20230801092127-b85bfd5d395a/internal/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  {{ end }}