Sha256: 9de59ac59c1cc85b196e5725bf63b23d3d7bcb981cf63526ae44a278409e09eb

Contents?: true

Size: 572 Bytes

Versions: 697

Compression:

Stored size: 572 Bytes

Contents

<label>
  <span for="product-sort">Sort by:</span>
  
  <select id="product-sort" style="margin: 0 !important">
    <% @sort_options.each do |sort_option| %>
      <option value="<%= sort_option[:value] %>" <%= 'selected' if params[:sort] == sort_option[:value] %>><%= sort_option[:name] %></option>
    <% end %>
  </select>
</label>

<% content_for :caboose_js do %>
  <script>
    $(document).ready(function() {
      $('#product-sort').on('change', function(event) {
        window.location = '/products?sort=' + $(this).val();
      });
    });
  </script>
<% end %>

Version data entries

697 entries across 697 versions & 2 rubygems

Version Path
caboose-cms-0.9.229 app/views/caboose/products/_sort_options.html.erb
caboose-cms-1.0.2 app/views/caboose/products/_sort_options.html.erb
caboose-cms-1.0.1 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.228 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.227 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.226 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.225 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.224 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.223 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.222 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.221 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.220 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.219 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.218 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.217 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.216 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.215 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.214 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.213 app/views/caboose/products/_sort_options.html.erb
caboose-cms-0.9.212 app/views/caboose/products/_sort_options.html.erb