assaf/vanity — pull request #126 by iceberg901 (2013-01-16 00:47:26+00:00)
Title: Added vanity_experiments helper for rails to return read only copy of active experiments

I created this vanity_experiments helper to give clients of vanity a read only copy of all of the active experiments and alternatives on the page, without the chance of messing up vanity internal data. Two great uses I already have for this:

1. Automatically push all of the active ab test alternatives on a page into a javascript object so they can be acted upon in client-side js, not just in rails. Previously I would have to pass them all manually (custom code for each experiment) from rails/ruby through the templates to the js.

2. Render information about all active ab test alternatives on a page in development environment.

Hope this is useful and can be included in vanity! Thanks.