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
#!/bin/bash | |
startme() { | |
cd ~/vas/vas | |
/home/abejide/.rvm/gems/ruby-1.9.2-p180/bin/rackup faye.ru -s thin -E production & | |
/home/abejide/.rvm/gems/ruby-1.9.2-p180/bin/rails s | |
} | |
stopme() { |
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
ajaxsearch_controller.rb | |
class AjaxsearchController < ApplicationController | |
def new | |
begin | |
@search = Sugar.find(:all, :conditions => {:first_name => "LIKE '%#{params[:name]}%'"}).collect{ |user| "<tr><td><b><a href='http://10.10.5.104:8080/wakanow/index.php?module=Contacts&action=DetailView&record="+"#{user.id}" + "'>" + "#{user.account_name}"+"</b></td>" + "</a><td>Email address: <b>" + "#{user.email1}"+"</b><a href=" + 'http://10.10.5.104:8080/wakanow/index.php?module=Contacts&action=DetailView&record=' + "#{user.id}" + "><img border=0 src='jquery/images/contacts.gif' title=" + "#{user.account_name}" + "/></a></tr>" } | |
# @search = Sugar.find(:all, :conditions => {:first_name => "LIKE '%#{params[:name]}'"}).collect{ |user| { :first_name => user.first_name :id => user.account_id, :name => user.account_name }} | |
rescue | |
@search = Sugar.find(:all, :conditions => {:first_name => "LIKE '%#{params[:name]}%'"}).collect{ |user| "<tr><td><b><a href='http://10.10.5.104:8080/wakanow/index.php? |
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 AjaxsearchController < ApplicationController | |
require 'stalker' | |
def new | |
begin | |
@search = Sugar.find(:all, :conditions => {:first_name => "LIKE '%#{params[:name]}%'"}).collect{ |user| "<tr><td><b><a href='http://10.10.5.104:8080/wakanow/index.php?module=Contacts&action=DetailView&record="+"#{user.id}" + "'>" + "#{user.account_name}"+"</b></td>" + "</a><td>Email address: <b>" + "#{user.email1}"+"</b><a href=" + 'http://10.10.5.104:8080/wakanow/index.php?module=Contacts&action=DetailView&record=' + "#{user.id}" + "><img border=0 src='jquery/images/contacts.gif' title=" + "#{user.account_name}" + "/></a></tr>" } | |
# @search = Sugar.find(:all, :conditions => {:first_name => "LIKE '%#{params[:name]}'"}).collect{ |user| { :first_name => user.first_name :id => user.account_id, :name => user.account_name }} | |
rescue | |
@search = Sugar.find(:all, :conditions => {:first_name => "LIKE '%#{params[:name]}%'"}).collect{ |user| "<tr><td><b><a href='http://10.10.5.104:8080/wakanow/index.php?module=C |
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
job.rb | |
require File.expand_path("../environment", __FILE__) | |
require 'faye' | |
job "sugar.find" do |args| | |
begin | |
=begin | |
faye = Faye::Client.new('http://10.10.5.96:9292/faye') | |
msge = JSON.dump('channel' => "/ajaxsearches", 'data' => {'exten_no' => "#{@ajaxsearches.extenno}", 'resarray' => "#{@search}"}) |
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
$(function(){ | |
var client = new Faye.Client('http://10.10.5.96:9292/faye'); | |
client.subscribe("/ajaxsearches", function(data) { | |
var exten = (data.exten_no); | |
var searcharray = (data.resarray); | |
var contact = "<a href= 'http://10.10.5.104:8080/wakanow/index.php?module=Contacts&action=EditView&return_module=Contacts&return_action=index' title='Create Contact'>Create Contact</a>" | |
var contactImage = "<a href= 'http://10.10.5.104:8080/wakanow/index.php?module=Contacts&action=EditView&return_module=Contacts&return_action=index' title='Create Contact'><img title='Create Contact' border=0 src='jquery/images/contact_plus.gif'/></a>" | |
var service = "<a href= 'http://10.10.5.104:8080/wakanow/index.php?module=Cases&action=EditView&return_module=Cases&return_action=index' title='Service Request'>Service Request</a>" |
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
switchvox.yml | |
default: | |
switchvox_ip: PBX.IP.Com | |
faye_ip: 0.0.0.0:9292 | |
development: | |
switchvox_ip: PBX.IP.Com | |
faye_ip: 0.0.0.0:9292 | |
production: |
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
Sugar.count(:conditions => {:phone_work => "LIKE %#{params[:cid_number]}%"}) | |
You have a nil object when you didn't expect it! | |
You might have expected an instance of ActiveRecord::Base. | |
The error occurred while evaluating nil | |
sugar.rb | |
#the class defines the webservices to connect to sugarCRM | |
class Sugar < SugarCRM::Contact | |
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
$(function(){ | |
var client = new Faye.Client('http://10.10.5.96:9292/faye'); | |
client.subscribe("/ajaxsearches", function(data) { | |
exten = (data.exten_no); | |
searcharray = (data.resarray); | |
contact = "<a href= 'http://10.10.5.104:8080/wakanow/index.php?module=Contacts&action=EditView&return_module=Contacts&return_action=index' title='Create Contact'>Create Contact</a>" | |
contactImage = "<a href= 'http://10.10.5.104:8080/wakanow/index.php?module=Contacts&action=EditView&return_module=Contacts&return_action=index' title='Create Contact'><img title='Create Contact' border=0 src='jquery/images/contact_plus.gif'/></a>" | |
service = "<a href= 'http://10.10.5.104:8080/wakanow/index.php?module=Cases&action=EditView&return_module=Cases&return_action=index' title='Service Request'>Service Request</a>" |
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
/home/zeep/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rails (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8] (Gem::LoadError) | |
from /home/zeep/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec' | |
from /home/zeep/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1195:in `gem' | |
from /home/zeep/.rvm/gems/ruby-1.9.2-p290/bin/rails:18:in `<main>' | |
/home/zeep/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rack (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8] (Gem::LoadError) | |
from /home/zeep/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec' | |
from /home/zeep/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1195:in `gem' | |
from /home/zeep/.rvm/gems/ruby-1.9.2-p290/bin/rackup:18:in `<main>' | |
/usr/bin/env: ruby: No such file or directory |
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
/home/zeep/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rails (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8] (Gem::LoadError) | |
from /home/zeep/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec' | |
from /home/zeep/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1195:in `gem' | |
from /home/zeep/.rvm/gems/ruby-1.9.2-p290/bin/rails:18:in `<main>' | |
/home/zeep/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rack (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8] (Gem::LoadError) | |
from /home/zeep/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec' | |
from /home/zeep/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1195:in `gem' | |
from /home/zeep/.rvm/gems/ruby-1.9.2-p290/bin/rackup:18:in `<main>' | |
/usr/bin/env: ruby: No such file or directory |