Sha256: 444ccbde2e09d1ec49907c54eb304a903d21f95f22d3077052ffbc73b4981d08

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

<% score = experiment.score %>
<table>
  <caption>
    <%= experiment.conclusion(score).join(" ") %></caption>
  <% score.alts.each do |alt| %>
    <tr class="<%= "choice" if score.choice == alt %>">
      <td class="option"><%= alt.name.gsub(/^o/, "O") %>:</td>
      <td class="value"><code><%=h alt.value.to_s %></code></td>
      <td>
        <%= "%.1f%%" % [alt.conversion_rate * 100] %>
        <%= "(%d%% better than %s)" % [alt.difference, score.least.name] if alt.difference && alt.difference >= 1 %>
      </td>
      <td class="action">
        <% if experiment.active? && respond_to?(:chooses_experiments_url) %>
          <% if experiment.showing?(alt) %>
            showing
          <% else %>
            <%= link_to_remote "show", update: "experiment_#{experiment.id}",
                  url: chooses_experiments_url(e: experiment.id, a: alt.id), method: :post,
                  html: { class: "button", title: "Show me this alternative from now on" } %>
          <% end %>
        <% end %>
      </td>
    </tr>
  <% end %>
</table>
<%=  %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vanity-1.0.0 lib/vanity/templates/_ab_test.erb
vanity-0.4.0 lib/vanity/templates/_ab_test.erb