Adding a namespaced Rails generator to a standalone Ruby gem

I wanted to add a generator to the SugarCRM ruby gem, but couldn’t find any straightforward resources on doing just that: taking a standalone ruby gem, and adding a generator that is available from within a Rails environment. To make matters more interesting, I wanted this generator to be namespaced: instead of calling `config`, I wanted to call `sugarcrm:config`. Continue reading

Posted in Rails, Ruby, SugarCRM Ruby gem | 2 Comments

Contributing to open source

Although contributing to open source projects now seems natural to me, there was a time when it was quite daunting and I had no idea where to start. Here, I’ll guide you through the steps I took to add some functionality to a rails plugin I wanted to use. Continue reading

Posted in Rails | Comments Off on Contributing to open source

Why Service-Oriented Architecture makes sense

Service-Oriented Architecture (SOA) has been around for a long time, but in the last years it has started to become the obvious solution to many problems: where RPC, and CORBA are unwieldy, and big entreprisey J2EE apps communicating with SOAP are a pain to work with, web apps using JSON are a godsend. Continue reading

Posted in Architecture | Comments Off on Why Service-Oriented Architecture makes sense

Self-marking required fields in Rails 3

In a Rails 3 project I’m currently working on, I wanted to mark required fields automatically: if the model required the field to be present (via validates :presence => true or validates_presence_of), that field in the form would automatically be marked as required. Since I couldn’t find any resources on doing this by augmenting FormBuilder, I’ll guide you through it. Continue reading

Posted in Rails | 19 Comments

Your laptop is a liability

You got up early this morning to catch your flight, but your taxi still got stuck in traffic. After checking in (thank God for electronic check in!), you’re now stuck at the security check behind someone who evidently decided storing metal objects in his pockets was a good idea. So there you are, carry on sitting on the conveyor belt on its way to be x-rayed while you wait in line. In your socks.

When you finally make it through the security checkpoint, you pick up your carry on, put on your shoes, and then it hits you: your laptop bag is nowhere to be seen. The pieces fall into place quickly: the man ahead of you was purposefully stalling you while an accomplice stole your computer. Continue reading

Posted in Uncategorized | Tagged , , | Comments Off on Your laptop is a liability

Consuming a public Rails API with jQuery

A previous post explained how to implement a public API in Rails. Here, we will cover how this API can be consumed with a cross-domain request using jQuery.

The idea

We’ll create a simple html file containing <ul> elements with an id. We’ll then use jQuery to fetch data (references and quantities) from the API provided by the Rails app we wrote in the previous post. Continue reading

Posted in AJAX, jQuery | 4 Comments

Implementing a public API in Rails 3

As you’re probably aware, Rails helps out a lot when using generators: in addition to generating the views, it also provides XML access to data. What we’ll cover today is implementing a basic public API that can be consumed from outside our app (i.e. with cross-domain requests). Continue reading

Posted in Rails | 10 Comments

Ruby Gem for SugarCRM: Advanced use

This is an article about “advanced” use of the SugarCRM Ruby gem. We’ve previously covered using basic gem functionality, and building a simple rails app using the gem to make a CRM portal, so you might want to take a look at those first. Continue reading

Posted in CRM, Ruby, SugarCRM Ruby gem | Comments Off on Ruby Gem for SugarCRM: Advanced use

Ruby Gem for SugarCRM: Ruby on Rails Integration

Having gone over the basics in a previous article, we will now cover how you can get a basic Rails 3 app (using the SugarCRM Ruby gem) up and running. (The SugarCRM Ruby gem relies on ActiveSupport >= 3, and therefore isn’t compatible with Rails 2. ActiveSupport >= 2.3.9, but is optimized for Rails/ActiveSupport 3.) Continue reading

Posted in CRM, Rails, Ruby, SugarCRM Ruby gem | 4 Comments

Ruby Gem for SugarCRM: the Basics

The Ruby gem for SugarCRM has already been briefly presented in a SugarCRM Developer Zone article, but has been drastically improved over the last months. In the following lines, we’ll go over a few of these improvements and show you how leveraging SugarCRM can be greatly improved. Continue reading

Posted in CRM, Ruby, SugarCRM Ruby gem | 7 Comments