浏览代码

Updated template and readme

Andrew Kane 9 年之前
父节点
当前提交
1cd816ecf5
共有 2 个文件被更改,包括 10 次插入4 次删除
  1. 8 0
      README.md
  2. 2 4
      lib/generators/blazer/templates/config.yml

+ 8 - 0
README.md

@@ -191,6 +191,14 @@ smart_variables:
 
 
 The first column is the value of the variable, and the second column is the label.
 The first column is the value of the variable, and the second column is the label.
 
 
+You can also use an array or hash for static data and enums.
+
+```yml
+smart_variables:
+  period: ["day", "week", "month"]
+  status: {0: "Active", 1: "Archived"}
+```
+
 ### Linked Columns
 ### Linked Columns
 
 
 [Example](https://blazerme.herokuapp.com/queries/3-linked-column) - title column
 [Example](https://blazerme.herokuapp.com/queries/3-linked-column) - title column

+ 2 - 4
lib/generators/blazer/templates/config.yml

@@ -23,10 +23,8 @@ data_sources:
 
 
     smart_variables:
     smart_variables:
       # zone_id: "SELECT id, name FROM zones ORDER BY name ASC"
       # zone_id: "SELECT id, name FROM zones ORDER BY name ASC"
-      #=== You can use it as Array
-      # zone_name: ['Zone 1', 'Zone 2']
-      #=== or as Hash
-      # zone_type: {type_1: 'Type 1', type_2: 'Type 2'}
+      # period: ["day", "week", "month"]
+      # status: {0: "Active", 1: "Archived"}
 
 
     linked_columns:
     linked_columns:
       # user_id: "/admin/users/{value}"
       # user_id: "/admin/users/{value}"