Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Experiment Driven Development for Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.rdoc

Vanity is an Experiment Driven Development framework for Rails.

Requires Ruby 1.9.1 or later, Redis 1.0 or later.

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

Add Vanity to your Rails app:

class ApplicationController < ActionController::Base
  use_vanity :current_user
end

Define an A/B test. This test compares three pricing options:

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

Present different options to the user:

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

Measure conversion:

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

Check the report:

vanity --output vanity.html

Learn more about Vanity: assaf.github.com/vanity

Credits

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

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

Something went wrong with that request. Please try again.