着陆页的不同变体

时间:2013-12-14 00:38:40

标签: jquery css ruby-on-rails html5 ruby-on-rails-4

所以我有一些嘲讽,并且有一些不同的着陆页可以让我每次加载时都能有不同的着陆页变体?

landingpage.html.erb

<%= render "shared/header" %>

<%# Begin background image cycler on landing page %>
<div id="background_cycler" >

  <script type="text/javascript">
$('#background_cycler').hide();//hide the background while the images load, ready to fade in later
</script>

<%= image_tag("background-guys-game.png", alt: "") %>
<%= image_tag("background-neutral.png",  class: "active", alt: "") %>
<%= image_tag("background-girls.png",  alt: "") %>
<%= image_tag("bg-wheel.png",  alt: "") %>
<%= image_tag("bg-train.png",  alt: "") %>
<%= image_tag("bg-girls2.png",  alt: "") %>
<%= image_tag("bg-room.png",  alt: "") %>

</div>
<%# End of background image cycler on landing page %>

<div id="landing_page">
  <div class="top-section <%= background_image_class %>">
    <div class="container">
      <h2 class="main_message">
       Meet people like you near you
     </h2>
     <div class="join-screenshot">
      <div class="join">
        <%= form_for User.new, url: user_registration_path(User.new) do |f| %>
        <h3>Join Now</h3>
        <div class="fieldset">
          <div class="control-group">
            <%= f.text_field "email", placeholder: "Your Email", required: true, autocomplete: :off %>
          </div>
          <div class="control-group">
            <%= f.password_field "password", placeholder: "Your Password", required: true, autocomplete: :off %>
          </div>
          <div class="control-group">
            <%= f.text_field "first_name", placeholder: "Your first name", required: true %>
          </div>
          <div class="control-group">
            <%= f.text_field "last_name", placeholder: "Your last name", required: true %>
          </div>
          <div class="control-group">
            <div class="radio-group-row">
              <label class="radio-group-title">
                Gender:
              </label>
              <label class="radio inline">
                <%= f.radio_button "gender", "M" %>
                Male
              </label>
              <label class="radio inline">
                <%= f.radio_button "gender", "F" %>
                Female
              </label>
            </div>
          </div>
          <div class="control-group submit">
            <button type="submit">
              SIGN UP
            </button>
          </div>
          <h5><%#= link_to "Sign in with Facebook", "/auth/facebook" %></h5>
        </div>
        <% end %>
      </div>
      <div class="screenshot">
        <%= image_tag "screenshot-filled.png" %>
      </div>
    </div>
  </div>
</div>
<div class="bottom-section">
  <div class="container">
    <div class="bullet-points">
      <div class="bullet clearfix">
        <div class="message pull-right">
          <h3>Sign up and fill out your interests</h3>
        </div>
        <div class="icon pull-left">
          <%= image_tag "interests_icon.png" %>
        </div>
      </div>
      <div class="bullet clearfix horz_gray">
        <div class="message pull-left">
          <h3>
            Discover people who share your
            <br/>
            interests
          </h3>
        </div>
        <div class="icon pull-right">
          <%= image_tag "share_interests.png" %>
        </div>
      </div>
      <div class="bullet clearfix">
        <div class="message pull-right">
          <h3>
            Set up a time to go hang out
          </h3>
        </div>
        <div class="icon pull-left">
          <%= image_tag "calendar-icon.png" %>
        </div>
      </div>
      <div class="bullet clearfix horz_gray">
        <div class="message pull-left">
          <h3>
            Break the ice online.
            <br/>
            Hang out offline
          </h3>
        </div>
        <div class="icon pull-right">
          <%= image_tag "break-ice-icon.png" %>
        </div>
      </div>
    </div>
    <br />
    <h2 id="join1">
     Meet people like you near you
   </h2>
   <br />
   <div id="join"><h1><%=link_to "Join Now", new_user_registration_path, class: "btn btn-warning" %></h1></div>
   <br />
   <%= render '/shared/footer' %>
 </div>
</div>
</div>

2 个答案:

答案 0 :(得分:1)

超级简单版本,如果你不需要做任何花哨的事情。

# PagesController
def landing
  number = rand(1) + 1
  render "landing_#{number}"
end

浏览

# app/views/page/landing_1.html.erb
# app/views/page/landing_2.html.erb

如果您不想在Rails中执行此操作,可以在Google Analytic中完成跟踪工作。

答案 1 :(得分:0)

A / Bingo和Vanity是执行此操作的Rails框架。

我猜你想做A / B测试,Rails与这个问题重复A/B framework for Rails 3?

Smashing杂志也有一篇文章 http://www.smashingmagazine.com/2010/06/24/the-ultimate-guide-to-a-b-testing/