New on this site

GlossyBlue enhanced-wp-contactform Theme!

May 20th, 2007, filed under Apple, Articles, General, PHP, Ruby on Rails and has 2 comments

Installing a clean version of WordPress 2.2 also gave me a nice chance to update the theme. I've chosen to install the GlossyBlue theme created by N.Design Studio. He did an excellent job on creating this theme!

Continue reading...
Still Fresh

Create XML with Ruby (2 Methods explained)

March 8th, 2007, filed under Ruby on Rails and has 4 comments

Nowadays XML is a powerful thing. People can catch up easily with articles posted on all kinds of weblogs using RSS feeds. I've been working on a new webapplication using Ruby on Rails and Flex. There are several ways to get both of them communicating with each other. You could use the HTTPService (making an HTTP GET or POST request to the specified URL, and an HTTP response is returned) in Flex or install WebOrb as a plugin into a Rails application to expose Ruby classes as remote services.

Because I'm not allowed to install any Rails plugins on my webhost, it's impossible to use WebOrb. Therefore I'm forced to use XML as a dataprovider to Flex. There are two methods that can be used with Ruby that will generate XML.

Example 1: Create a controller, e.g. xml.rb, and add the following code:

def list
  @articles = Article.find(:all)
  render :xml => @articles.to_xml
end

When calling the xml controller and the action list, all information (every cell and row) from the table articles will be rendered into a XML file. Using this method is easy and fast. However, in my situation i needed more control over the XML file (accessing multiple tables). I need a more complex XML to be generated and have it imported into flex. Onto example 2!

Continue reading...
Microwavable

Create beautiful graphs with Ruby and Gruff

February 6th, 2007, filed under General, Ruby on Rails, Web 2.0 and has 1 comment
A picture is worth a thousand words. That's why our application will be capable of exporting data to beautiful pie graphs instead of outputting long lists of raw data. As a Mac user there are several options to develop your own Ruby on Rails (RoR) web application. I've always used Locomotive to develop my RoR web applications. Locomotive also offers you a RMagick Rails Bundle. This Bundle includes the ImageMagick package and Ruby RMagick bindings. The ImageMagick package and the Ruby RMagick bindings are the preferred tools of Rails experts for image manipulation - BUT are also notoriously difficult to properly install and configure. Locomotive spares you the pain. Just download the +RMagick bundle from the Bundles page and you're ready to go! Go check out some beautiful graph examples generated with Ruby and Gruff.
Stone Cold

Project description

November 16th, 2006, filed under Adobe Flex, AJAX, Ruby on Rails, Web 2.0 and has no comment
For those who do not understand what it is that I'm working on, please read this post as it will describe in short what the application will do. The main purpose is to create an application giving teachers the ability to create their online surveys meant for students. Here are some of the requirements;
  • Easy to use withouth any technical knowledge.
  • Guarantee students anonymity.
  • Web 2.0...next generation webapplication.
  • Maintaining usergroups.
  • Compare different surveys.
  • Export data to SPSS.
At this moment we're working both with AJAX and Flex combined with Ruby on Rails. By doing so we hope to get a better understanding of the capabilities and differences from these new web development techniques. In some of my previous posts I showed a little example of AJAX. Timo Vos, a colleague, created a small Flex demo. It's far from being advanced, however it does show that panels and data grids are easily built. Combined with a database and its nifty looks, Flex might be the winner during this project. Less coding, more fun! Expect more updates soon.
Stone Cold

Locomotive Mac OS X

October 17th, 2006, filed under Ruby on Rails and has no comment

Creating web-applications with Rails on your Mac requires a suitable environment to work with. First you need to install Locomotive. Using Locomotive keeps you (almost) safe from working in the terminal. Install Locomotive with a simple drag and drop to your applications folder. That's it!

Before starting Locomotive make sure (if you want to use any) you have access to a MySQL database. This can run either local or external.

Run Locomotive on your Mac and create a new application (command + n). Define your application name and location. When done take a look at the port it will listen to. Port 3000 is used by default. Now you are able to access your new application through any webbrowser using the following address (using the default port):

localhost:3000

Please read the Rails Framework Documentation and Ruby on Rails Wiki for more information about programming in Rails.