Skip to content

Instantly share code, notes, and snippets.

View robertwclark's full-sized avatar

Robert Clark robertwclark

View GitHub Profile
@charset "UTF-8";
/* CSS Document - general css here */
html p h1 h2 h3 h4 h5 {
font-family: 'Source Sans Pro', sans-serif;
color:#424242;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
@robertwclark
robertwclark / gist:4597802
Last active May 17, 2018 13:31
Google Chart with JSON
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var selectedValue = $("select option:selected").val()
var jsonData = $.ajax({
type: 'get',
url: '/social_scores/'+selectedValue,
dataType:"json",
success: function(response, status, jqXHR) {
@robertwclark
robertwclark / socialentity_dropdown
Last active December 11, 2015 07:29
Dropdown for socialentity
<%= collection_select(:social_entity,:id, load_entities, :name, :id)%>
Renders
<select id="socialentity_id" name="socialentity[id]">
<option value="1" selected="selected">DataSimply</option>
<option value="2">mbonat</option>
<option value="3">OpenLabel</option>
<option value="4">scrible</option>
@robertwclark
robertwclark / nestedform
Created December 1, 2012 02:29
Nested Form Build
class Organization < ActiveRecord::Base
attr_accessible :name, :employee_number, :country, :postal_code, :sic_code, :primary_url, :social_entities_attributes, :social_channels_attributes
has_one :user
has_one :social_score, :through => :social_entities
has_many :social_entities
has_many :social_channels, :through => :social_entities
accepts_nested_attributes_for :social_entities, :social_channels
end
@robertwclark
robertwclark / gist:3092217
Created July 11, 2012 18:32
Activation Email Problems
## From User Model ##
def send_activation_email
reset_perishable_token!
UserMailer.activation(self).deliver
end
##Controller for Activation Email##
class ActivationsController < ApplicationController
def create
if @user = User.find_using_perishable_token(params[:token])