github.com/jacobsoderblom/buffalo@v0.11.0/generators/action/templates.go (about) 1 package action 2 3 const ( 4 actionsHeaderTmpl = `package actions 5 import "github.com/gobuffalo/buffalo"` 6 7 viewTmpl = `<h1>{{.opts.Name.Camel}}#{{.action}}</h1>` 8 9 actionsTmpl = ` 10 {{ range $action := .actions }} 11 // {{$.opts.Name.Camel}}{{$action.Camel}} default implementation. 12 func {{$.opts.Name.Camel}}{{$action.Camel}}(c buffalo.Context) error { 13 return c.Render(200, r.HTML("{{$.opts.Name.File}}/{{$action.File}}.html")) 14 } 15 {{end}}` 16 17 testHeaderTmpl = `package actions 18 19 import ( 20 "testing" 21 22 "github.com/stretchr/testify/require" 23 ) 24 ` 25 26 testsTmpl = ` 27 {{ range $action := .tests}} 28 func (as *ActionSuite) Test_{{$.opts.Name.Camel}}_{{$action.Camel}}() { 29 as.Fail("Not Implemented!") 30 } 31 32 {{end}}` 33 )