【问题标题】:Different variations of the landing page着陆页的不同变体
【发布时间】:2013-12-14 00:38:39
【问题描述】:

所以我有一些模拟,以及着陆页的一些不同变体,有没有一种方法可以在每次加载时显示着陆页的不同变体?

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>

【问题讨论】:

  • 你的意思是你有不同的登陆页面,并且想随机呈现其中一个?

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


【解决方案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 中完成。

【讨论】:

    【解决方案2】:

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

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

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

    【讨论】:

      猜你喜欢
      • 2023-02-13
      • 1970-01-01
      • 2021-06-02
      • 1970-01-01
      • 2019-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多