Skip to content

Instantly share code, notes, and snippets.

View killthekitten's full-sized avatar
🇺🇦

Nikolay Shebanov killthekitten

🇺🇦
View GitHub Profile
<table>
<tr class='entry_header'>
<th>Task</th>
<% @timesheet.date_range.each do |week_date| %>
<th><%= week_date.to_formatted_s(:short) %></th>
<% end %>
</tr>
<tr class="fields">
<td><%= f.collection_select(:task_id, @tasks, :id, :name, prompt: true) %></td>
<%= f.fields_for :time_entries do |builder|%>
@killthekitten
killthekitten / custom_searcher.rb
Last active December 10, 2015 20:08 — forked from ashga/product_decorator.rb
Dumb way to filter products by multiple properties in Spree.
class CustomSearch < Spree::Core::Search::Base
protected
def add_search_scopes(base_scope)
statement = nil
search.each do |property_name, property_values|
property = Spree::Property.find_by_name(property_name.gsub("_any", ""))
next unless property
substatement = product_property[:property_id].eq(property.id).and(product_property[:value].eq(property_values.first))
@killthekitten
killthekitten / README.md
Last active December 10, 2015 11:59 — forked from oguzbilgic/README.md

MyApp

Very short description of the application.

1. Ruby, Rails & Rubygems

Application is written in ruby language, using Ruby on Rails web framework.