Sha256: 0117f084f18860d0cbc11a1e1c918af39d408f45b938aa3664bcbade160469d8

Contents?: true

Size: 767 Bytes

Versions: 68

Compression:

Stored size: 767 Bytes

Contents

<%= form.label name, label, for: "activity_#{ name }" %>

<% 
min_text ||= "None" 
mid_text ||= "Some"
max_text ||= "A Lot"
include_blank ||= false
parameter_prefix ||= "activity"
%>

<select name="<%= parameter_prefix %>[<%= name %>]" id="activity_<%= name %>" class="form-control" data-selector="<%= (defined? index)? index : 0 %>">
  <% if include_blank %>
    <option></option>
  <% end %>
  <% (0..10).each do |value| %>
    <option value="<%= value %>" data-intensity="<%= value %>">
      <% if value == 0 || value == 5 || value == 10 %>
        <% suffix = (value == 0)? min_text : ((value == 5)? mid_text : max_text) %>
        <%= value.to_s + " (" + suffix + ")" %>
      <% else %>
        <%= value %>
      <% end %>
    </option>
  <% end %>
</select>

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
think_feel_do_engine-3.22.9 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.22.8 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.22.7 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.22.6 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.22.5 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.22.4 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.22.2 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.22.1 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.22.0 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.21.2 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.21.1 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.21.0 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.20.1 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.19.9 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.19.8 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.19.7 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.19.6 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.19.5 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.19.4 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb
think_feel_do_engine-3.19.3 app/views/think_feel_do_engine/activities/_intensity_selector.html.erb