Explorar o código

Fixing document generator

Andrea Fazzi %!s(int64=5) %!d(string=hai) anos
pai
achega
c542bb2386
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      renderer/funcmap.go

+ 5 - 1
renderer/funcmap.go

@@ -194,7 +194,11 @@ func show(model string, id uint, format ...string) string {
 	plural := inflection.Plural(strings.ToLower(model))
 
 	args := []string{"tpl_layout", "base", "tpl_content", fmt.Sprintf("%s_%s", plural, action)}
-	args = append(args, format...)
+
+	if len(format) > 0 {
+		args = append(args, []string{"format", format[0]}...)
+	}
+
 	// q := query("tpl_layout", "base", "tpl_content", fmt.Sprintf("%s_%s", plural, action))
 	q := query(args...)