Skip to content

Instantly share code, notes, and snippets.

@fidel
Created February 16, 2013 11:02
Show Gist options
  • Save fidel/4966444 to your computer and use it in GitHub Desktop.
Save fidel/4966444 to your computer and use it in GitHub Desktop.
<% if notice %>
<p id="notice"><%= notice %></p>
<% end %>
<h1><%= t('.title_html') %></h1>
<%= form_tag search_path, method: :get do %>
<p>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search", :name => nil %>
</p>
<% end %>
<div id="facets">
<h3>Published</h3>
<ul>
<% for row in @search.facet(:publish_month).rows %>
<li>
<% if params[:month].blank? %>
<%= link_to row.value, :month => row.value %>(<%= row.count %>)
<% else %>
<strong><%= row.value %></strong>(<%= link_to "remove", month: nil %>)
<% @products.each do |product| %>
<div class="entry">
<%= image_tag(product.image_url) %>
<h3><%= link_to product.title, product %></h3>
<p><%= sanitize(product.description) %></p>
<div class="price_line">
<span class="price"><%= number_to_currency(product.price) %></span>
<%= button_to t('.add_html'), line_items_path(product_id: product),
remote: true %>
</div>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment