Skip to content

Instantly share code, notes, and snippets.


Stu C stuartchaney

View GitHub Profile
stuartchaney / highcharts includes
Created Apr 9, 2011
include the nessecary files
View highcharts includes
<%= javascript_include_tag "jquery-1.4.2", "rails", "highcharts" %>
stuartchaney / highcharts js code
Created Apr 9, 2011
ruby embedded highcharts js
View highcharts js code
<div id="fb_chart" style="width: 100%; height: 300px;"></div>
<% content_for :javascripts do %>
<script type="text/javascript">
new Highcharts.Chart({
chart: { renderTo: 'fb_chart', defaultSeriesType: 'area' },
title: { text: 'Facebook Publish to Token Rate per Day' },
xAxis: { type: 'datetime' },
View searchlogic config
config.gem searchlogic
View searchlogic config
config.gem searchlogic
View searchlogic examples
Equates to:
SELECT * FROM "posts" WHERE ( NOT LIKE '%foo%')
View gist:911537
SELECT * FROM "posts" WHERE ((posts.views < 200) AND ((posts.views > 50) AND ( LIKE '%foo%')))
View gist:911538
Post.category_type like(“fun”)
Post Load (0.4ms) SELECT "posts".* FROM "posts" INNER JOIN "categories" ON "categories".id = "posts".category_id WHERE (categories.type LIKE '%fun%')
View gist:911539 => "fun").
View gist:911541
@search =[:search])
@posts = @search.all
View gist:911543
<% form_for @search do |f| %>
<%= f.label :name_like, "Name" %>
<%= f.text_field :name_like %>
<%= f.label :category_id_equals, "Category" %>
<%= f.collection_select :category_id_equals, Category.all, :id, :name, :include_blank => true %>