Module: Vanity::Rails::Dashboard
- Defined in:
- lib/vanity/frameworks/rails.rb
Overview
Step 1: Add a new resource in config/routes.rb:
map.vanity "/vanity/:action/:id", :controller=>:vanity
Step 2: Create a new experiments controller:
class VanityController < ApplicationController
include Vanity::Rails::Dashboard
end
Step 3: Open your browser to localhost:3000/vanity
Instance Method Summary collapse
Instance Method Details
#chooses ⇒ Object
184 185 186 187 188 |
# File 'lib/vanity/frameworks/rails.rb', line 184 def chooses exp = Vanity.playground.experiment(params[:e]) exp.chooses(exp.alternatives[params[:a].to_i].value) render :file=>Vanity.template("_experiment"), :locals=>{:experiment=>exp} end |