Permalink
Browse files

Show example of using an ActiveRelation::Relation with render :rgviz

  • Loading branch information...
1 parent 92f4c4c commit 193632ceabc840b8327bf21877c59a74f29a0ab5 asterite committed Sep 13, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 README.markdown
View
@@ -89,6 +89,10 @@ or also:
render :rgviz => Person, :conditions => 'age > 20'
+or (Rails 3 only):
+
+ render :rgviz => Person.where('age > ?', 20)
+
Preprocessing
-------------
@@ -132,7 +136,7 @@ For example, in your controller you put:
render :rgviz => Person, :virtual_columns => {
'age_range' => {
- :sql => "case when age < 20 then 'young' else 'old' end",
+ :sql => "case when age < 20 then 'young' else 'old' end",
:type => :string
}
}

0 comments on commit 193632c

Please sign in to comment.