Ruby posts.

Mustache And Rails3

Mustach Rails3

If your UI needs to hold state and do a little more then just returning a html string and
updating a dom element(not that cool); then json is the way to go.
Javascript is powerful so it can just receive the json and it can handle the state [...]

Quick install for ruby 1.9.1 and Rubygems 1.3.5 from source on Ubuntu.

Here’s a quick howto guide on installing Ruby 1.9.1, Rubygems 1.3.5 and dependencies on Ubuntu.

The apt-sources version of Ruby is not the latest version, as such it is better to compile everything from source.

First make sure your package sources are up to date and you have build essential and zlib1g-dev installed:

sudo apt-get update
sudo apt-get install [...]

MongoMapper state machine? just use active model’s state machine

MongoMapper

Active Model State Machine


So you want a state machine for you mongo mapper? Active model now comes with a nice looking state machine;
I really like the multi parameters you can send to the on_transition methods;

class StateMachineSubject
state_machine :chetan_patil, :initial => :sleeping do
[...]

Sitemap Generator for Ruby on Rails Applications

Follow these steps if you wish to add a sitemap.xml generator to a rails application. The idea is to generate a sitemap.xml for selected records from the database, in this case they are Articles and Categories. This sitemap is pinged to popular search engines like google, yahoo, bing and ask.

Step 1:
Add a sitemap.rb file to [...]

Birdpie Launched on Rails 3.0

We have just released Birdpie, a small twitter application for storing and managing the urls that you tweet. Birdpie utilises Twitter auth in order to simplify the sign up process and is Dynamic50’s first experimentation with Rails 3.0 pre.Once a user is signed up, Birdpie fetches all previous bookmarks (or as many allowed by [...]

3D Secure Transactions using SagePay Gateway and ActiveMerchant Plugin

Introduction

What is 3D secure?

3D Secure is a latest initiative for fraud prevention launched by Visa and MasterCard. 3D Secure adds additional password authentication step to complete the online transactions. A detailed introduction is available at http://www.sagepay.com/developers/industry_knowledge/3d_secure.asp.
This tutorial is a guide to set up a Ruby on Rails test environment for 3D Secure payment transactions using [...]

How we used Amazon Cloudfront as a CDN with Rails assets

Amazon Cloudfront is a great way of serving your assets for your site from localised buckets.

Firstly you need to set up a new distribution from your amazon CloudFront console here.

Associate your distribution with a current bucket, or alternatively with a new bucket name, but if you do this you will need to create the bucket [...]

Textmate issues – env: ruby: No such file or directory

One of the issues that keeps on rearing its ugly head, and I have never got round to fixing is the following error locally on Textmate:

env: ruby: No such file or directory

Well today I decided to put an end to it!

Textmate assumes (wrongly in my case) that Ruby is located at:

/usr/local/bin/ruby

Whereas a quick check on [...]

Gem to interact with the Amee Project Api

What is the Amee Project?

In a nut shell its a project to measure the “Carbon Footprint” of everything on Earth.

Amee

If you fancy interacting with the service then you might want to look at

d50s Gem.

Using Rack to test external api’s would that not be nice

Just had a thought. If we could use our integration specs against a rack application for external api’s

Then the vendor could just update their small rack application that would fire back up to date api calls. We could then just check that we have latest rack application to test against; Also that way we would [...]