RailsCasts Pro episodes are now free!
Learn more or hide this
Resources
script/plugin install git://git.bingocardcreator.com/abingo.git script/generate abingo_migration rake db:migrate script/generate controller abingo_dashboard script/plugin install --force git://github.com/ryanb/abingo.git
bingo! "signup_intro" bingo! "signup_title" # or bingo! "signup"
before_filter :set_abingo_identity private def set_abingo_identity if request.user_agent =~ /\b(Baidu|Gigabot|Googlebot|libwww-perl|lwp-trivial|msnbot|SiteUptime|Slurp|WordPress|ZIBB|ZyBorg)\b/i Abingo.identity = "robot" elsif current_user Abingo.identity = current_user.id else session[:abingo_identity] ||= rand(10 ** 10) Abingo.identity = session[:abingo_identity] end end
class AbingoDashboardController < ApplicationController # TODO add some authorization include Abingo::Controller::Dashboard end
map.abingo_dashboard "/abingo/:action/:id", :controller=> :abingo_dashboard
<% ab_test("signup_title", ["Sign up", "Registration", "Free Sign up"], :conversion => "signup") do |signup_title| %> <% title "Free Sign up" %> <% end %> <% if ab_test "signup_intro", nil, :conversion => "signup" %> <p>...</p> <% end %>