Browse Source

Updated template and readme

Andrew Kane 8 years ago
parent
commit
1cd816ecf5
2 changed files with 10 additions and 4 deletions
  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}"