diff --git a/runtime/command/new/controller/controller.go b/runtime/command/new/controller/controller.go index d8576f4ae..c4cc5ee70 100644 --- a/runtime/command/new/controller/controller.go +++ b/runtime/command/new/controller/controller.go @@ -80,12 +80,13 @@ type Action struct { } type View struct { - template string - Path string - Title string - Variable string - Singular string - Plural string + template string + Controller *Controller + Path string + Title string + Variable string + Singular string + Plural string } func (c *Command) Run(ctx context.Context) (err error) { @@ -160,12 +161,13 @@ func (c *Command) view(controller *Controller, action *Action) *View { template = defaultView } return &View{ - template: template, - Path: filepath.Join("view", controller.key, action.Name+".svelte"), - Title: text.Title(controller.Struct), - Variable: text.Camel(action.Result), - Singular: text.Camel(text.Singular(action.Result)), - Plural: text.Camel(text.Plural(action.Result)), + template: template, + Controller: controller, + Path: filepath.Join("view", controller.key, action.Name+".svelte"), + Title: text.Title(controller.Struct), + Variable: text.Camel(action.Result), + Singular: text.Camel(text.Singular(action.Result)), + Plural: text.Camel(text.Plural(action.Result)), } } diff --git a/runtime/command/new/controller/view/index.gotext b/runtime/command/new/controller/view/index.gotext index 69725241c..1cc1cfe91 100644 --- a/runtime/command/new/controller/view/index.gotext +++ b/runtime/command/new/controller/view/index.gotext @@ -15,8 +15,8 @@ {#each {{ $.Plural }} as {{ $.Singular -}} }