Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Experiment Driven Development for Ruby
Ruby JavaScript

This branch is even with assaf:usage

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
doc
lib
test
vendor/redis-0.1
CHANGELOG
MIT-LICENSE
README.rdoc
Rakefile
vanity.gemspec

README.rdoc

Vanity is an Experiment Driven Development framework for Rails.

A/B Testing with Rails (in 5 easy steps)

Step 1: Start using Vanity in your Rails application:

gem.config "vanity"

And:

class ApplicationController < ActionController::Base
  use_vanity :current_user
end

Step 2: Define your first A/B test. This experiment goes in the file experiments/price_options.rb:

ab_test "Price options" do
  description "Mirror, mirror on the wall, who's the better price of all?"
  alternatives 19, 25, 29
end

Step 3: Present the different options to your users:

<h2>Get started for only $<%= ab_test :price_options %> a month!</h2>

Step 4: Measure conversion:

class SignupController < ApplicationController
  def signup
    @account = Account.new(params[:account])
    if @account.save
      track! :pricing_options # <- here be conversion!
      redirect_to @acccount
    else
      render action: :offer
    end
  end
end

Step 5: Check the report:

vanity --output vanity.html

Credits/License

Copyright (C) 2009 Assaf Arkin, released under the MIT license.

Idea behind Experiment Driven Development: Nathaniel Talbott (blog.talbott.ws).

jQuery, Copyright © 2009 John Resig, released under the MIT license: dev.jquery.com

Flot, Copyright © 2007-2009 IOLA and Ole Laursen, released under teh MIT license: code.google.com/p/flot

Something went wrong with that request. Please try again.