Validating a Multistep Form With CoffeeScript & JQuery

December 27th, 2011 Posted by: (ELC) - posted under:Demo » Tutorial - 0 Comments

Recently I’m working with multistep form validation so I just want to throw this out here. This tutorial is done using Rails 3.1 with jQuery and CoffeeScript, but it can also be done by any web framework. The validation engine is done using jQuery validation plugin. A powerful plugin written and maintained by Jörn Zaefferer, a member of the jQuery team.

READ MORE

Generating API Documentation with rapi_doc

December 15th, 2011 Posted by: (ELC) - posted under:Tutorial - 0 Comments

Recently, we were looking for a tool that generate the API documentation that integrated into the Rails code base. We found RAPI Doc, which is initially started by Jaap van der Meer. Quoting from his blog post,
It generates a API controller containing documenation maked up in a special language. It parses controllers you specify, and generates a ApiController with appropriate views for it. This makes it very easy to document a Rest API.

READ MORE

Recurring billing subscription service with Active Merchant and Authorize.net

October 31st, 2011 Posted by: (ELC) - posted under:Demo » Project » Tutorial » Uncategorized - 0 Comments

Recently I was tasked with creating a recurring billing system for one of our projects, I thought I would share.
I decided to use Active Merchant a fantastic ruby library for handling payments from the studs over at Shopify. I’m using Paypal’s gateway for normal one time purchases as well as express payments, however at time of writing this Active Merchant doesn’t support Paypal for recurring billing so I’m using Authorize.net, a well established gateway with a good …

READ MORE

Inset border with CSS3 box-shadow

July 7th, 2011 Posted by: (ELC) - posted under:Demo - 1 Comment

A snazzy inset line can go a long way to making your design feel like it lives in a three dimensional world. I’m going to show you how I’ve been accomplishing this effect using CSS3′s super amazing box-shadow property.

READ MORE

Auction system using bayeux and node.js

May 10th, 2011 Posted by: (ELC) - posted under:Article - 0 Comments

Imagine you want to serve a page with a list of auctions and you want to keep your users aware of what’s happening. For example when someone clicks the buyout button you want to let them know that the auction is sold out, and remove it from the page in real time. Imagine you have thousands connected users and hundreds auctions, how do you prevent the system from collapsing?
The answer is probably the bayeux protocol. There are several implementation …

READ MORE

Upgrade to Rails 3.0.6

April 6th, 2011 Posted by: (ELC) - posted under:Uncategorized - 0 Comments

Rails 3.0.6 has just been released today after an important XSS security issue had been addressed. The auto_link method had previously been automatically marking input strings as html safe even if from an unknown origin. Upgrade encouraged for anybody riding rails pre 3.0.6.

READ MORE

Welcome to RubyGlob

February 10th, 2011 Posted by: (ELC) - posted under:Uncategorized - 0 Comments

Ruby on Rails, Rails, Ruby, RoR – there’s a lot of ways of saying it, and there’s a lot of ways of using it. RubyGlob is the extension of the ELC Technologies developer blog into a full blown web publication. Why? We love the environment, we love sharing our knowledge with the community, and most of all, we’d like to encourage more people to join our enthusiasm, as well as blog with us.
That wasn’t quite possible when we were just …

READ MORE

It’s Time To Double Up (Using Amazon’s RDS Read Replication Database Servers With Heroku For Master-Slave Replication)

January 25th, 2011 Posted by: (ELC) - posted under:Demo » General » Tutorial - 2 Comments

Heroku is great for rapid application development but if you want to run multiple databases it doesn’t provide any options. Running multiple databases in a master-slave orientation can provide an elegant solution to many scaling issues. This can be accomplished on heroku using my forked version of schoefmax’s gem multi_db.
First a quick look at master-slave replication
This database setup utilizes one or more read database(s) that only service read requests, and a master database that takes care of the …

READ MORE

Getting into arguments with JavaScript

January 4th, 2011 Posted by: (ELC) - posted under:General - 8 Comments

The arguments object in JavaScript looks like an array, but really it is just an array-like object. It has a length property that returns the number of arguments supplied to the calling function. And callee, which actually returns the calling function. Like an array, you can access the elements using an index:

// Remember, in JavaScript you can pass as many arguments
// to a function as you want.
function example() {
for(i=0; i < arguments.length; i++) {
console.log(arguments[i]);

READ MORE

Self Awareness (an exploration of the JavaScript Module Pattern)

December 21st, 2010 Posted by: (ELC) - posted under:General - 1 Comment

In starting a new JavaScript plugin, my coworker (Enrico Rubboli) and I began by looking at various design patterns to determine what would best suite our needs. After a bit of research we decided to go with the self executing module pattern. For example we have something like this (edited for brevity):
var Journal = (function() {

// Private variables and methods go here
return {

READ MORE