Skip to content

Instantly share code, notes, and snippets.

def new
11 @contact_fax = ContactFax.new
12 @contact_fax.contact_id = params[:contact]
13 @contact_fax.fax_id = params[:fax]
14
15 @contact = Contact.find(params[:contact])
16 @company = Company.find(@contact.company_id)
17
18 @fax = Fax.find(@contact_fax.fax_id)
19
@angelacode
angelacode / _form.html.erb
Created May 26, 2011 16:12
Getting jquery token to work with acts-as-taggable-on
- semantic_form_for @question do |f|
= f.input :title, :label => "Type Your Question",
:wrapper_html => {:style => "list-style-type:none"},
:input_html => {:class => 'main_question'}
= f.input :body, :input_html => {:class => 'autogrow', :rows => 5},
:wrapper_html => {:style => "list-style-type:none"},
:label => "Question Details (optional)"
= f.input :tag_list, :class => 'larger widest', :"data-pre" => @question.tags.map(&:attributes).to_json,
:wrapper_html => {:style => "list-style-type:none"}
@angelacode
angelacode / textmate
Created November 19, 2014 06:28
Textmate Syntax for Haml
{ patterns = (
{ begin = '^\s*==';
end = '$\n?';
contentName = 'string.quoted.double.ruby';
patterns = ( { include = '#interpolated_ruby'; } );
},
{ name = 'meta.prolog.haml';
match = '^(!!!)($|\s.*)';
captures = { 1 = { name = 'punctuation.definition.prolog.haml'; }; };
},
{:timestamp=>1463371169,
:environment=>"development",
:level=>"error",
:language=>"ruby",
:framework=>"ruby",
:server=>{:host=>"ruby-100042", :pid=>22381},
:notifier=>{:name=>"rollbar-gem", :version=>"2.2.1"},
:body=>
{:trace=>
{:frames=>
def search_by_query_return_array(query, limit = 100, sort = 'asc')
# return is an Array
# query is a query for Orchesetrate IO
# element from schedules orchestrate: https://github.com/angelacode/kaya-nitrous/wiki/schemas#collection--schedules
begin
logger.progname __method__
def initialize(collection, bot_client_id)
runscope_host = 'https://xxxxxxxxxx'
@client = Orchestrate::Client.new(ENV['ORCHESTRATE_API'], runscope_host)
@app = Orchestrate::Application.new(ENV['ORCHESTRATE_API'], runscope_host)
@bot_client_id = bot_client_id
@collection = collection
end