This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".call-to-action").live("click",function(e){ | |
register_user_modal($(this).attr("href")); | |
e.preventDefault(); | |
return false; | |
}); | |
function register_user_modal(target_link){ | |
var options = { | |
open:function(){ | |
$.get(target_link,{}, | |
function(r){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### USAGE ##### | |
# | |
# The StaticValue class gives you access to globally accessible constants through a human-readable and compact format. | |
# | |
# To define a new set of static values just define a class in this file such as: | |
# StaticValue.register('MyValues') | |
# | |
# Once your class is present you can add values to it via the add_item method: | |
# MyValues.add_item :Default, 0 | |
# MyValues.add_item :Custom, 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Effect < AR::Base | |
scope :my_scope, select('project_id, taskType, user_id, SUM(hours)').joins(:project_task).where(:project_tasks => {:project_id => 2, :taskType => 'Pre-Sales'}).group('user_id') | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TemplateHelper | |
def url_for(*args) | |
options = args.extract_options! | |
return super unless options.present? | |
handle = options.delete(:handlebars) | |
url = super(*(args.push(options))) | |
handle ? url.gsub(/%7B%7B(.+)%7D%7D/){|m| "{{#{$1}}}"} : url | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%title= meta(:title) | |
%meta{:name => 'robots', :content => meta(:robots)} | |
%meta{:name => 'description', :content => meta(:description)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var d = new Diabox({parser : function(target){ | |
// use target string to determine the renderable key. ie 'custom_key' | |
// return null if the target does not fit your criteria | |
}}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
observe_anchors : function(){ | |
box = this; | |
$(document.body).addEvent('click:relay(a[rel*="box"])', function(e){ | |
var a = e.target; | |
if(a.rel && a.rel.test(box.opt.rel_target)){ | |
box.set_loading(); | |
box.construct_renderable_from_link(a).render(); | |
e.stop(); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'exception_handler' | |
class ApplicationController < ActionController::Base | |
include YourApp::ExceptionHandler | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#attached_files | |
%p.declaration | |
Attachments: | |
%em | |
= add_object_link("add", "#attached_files", {:partial => '/attached_files/file', :locals => {:form => form}}) | |
- object.attached_files.each_with_index do |attachment, i| | |
= render :partial => '/attached_files/file', :locals => {:form => form, :attached_file => attachment, :child_index => i} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EnumerableClass | |
UNKNOWN_ENUMERABLE = "Unknown" | |
class << self | |
def all | |
self.to_a.collect{|g| g[1]} | |
end | |
def add_item(key,value) |