Przeglądaj źródła

Fixing document generator

Andrea Fazzi 5 lat temu
rodzic
commit
c542bb2386
1 zmienionych plików z 5 dodań i 1 usunięć
  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...)