RadRails or Emacs?

written February 24 2007 by
{ Kommen }
Comments 3

The last RadRails version 0.7.2 was released 3 months ago and it seems the RadRails-Team members are spending their time on other things. RadRails isn’t feature complete yet and there are still many bugs bugs waiting to be fixed.

And honestly, I don’t like to work with software, which needs some work but isn’t under maintenance/development any more.

So I (again) took a look at other Rails editors/IDEs to try out. After playing around with vim and emacs I decided to give emacs a try.

This article is continued. Click to read more!

Text-Link-Ads Plugin For Ruby On Rails

written February 12 2007 by
{ Kommen }
Comments 1

As Joe wrote in the article about our shiny new blog, he mentioned that we now use Text-Link-Ads for doing advertising on our blog.

Text-Link-Ads provide some adcode for Ruby On Rails applications, but using their code is not as convenient as it could be. Also, I had problems with some parts of it:
It seems that they overwrite a Rails method (request) which meshes up the application until you rename it.

I did some modifications to the adcode so I could use it more easily in the system. Then I extracted the code and created a Rails plugin. This plugin I want to share.

This article is continued. Click to read more!

Parse natural language date/time strings in Ruby with Chronic

written September 14 2006 by
{ Kommen }
Comments 1

Yesterday, while fighting against spam on the Ruby on Rails wiki, I came over a nice gem: Chronic

With Chronic you can easily parse natural language date and time formats into a DateTime object. You don’t have to mess around with regex to parse things manually. As gem, it’s easy to install and it’s also very handy to use.

Install it

$ gem install chronic
Thats it.

Use it

Put this in your model or controller file:


require 'chronic'


Then you can use Chronic.parse in your methods. E.g. Chronic.parse('tomorrow'),
Chronic.parse('monday', :context => :past), Chronic.parse('this tuesday 5:00')

Or more complex: Chronic.parse('3rd thursday this september'), Chronic.parse('3 months ago saturday at 5:00 pm')

And of course it can do a lot more! For a complete reference and more examples see chronic.rubyforge.org

Validate with it

 1 You can also use Chronic to validate malformed date strings:
 2 
 3 class Meeting < ActiveRecord::Base
 4 
 5   def validation
 6     errors.add :meeting_date, 'is not a valid date' if Chronic.parse(meeting_date.to_s).nil?
 7   end
 8 
 9 end

Ressources (Sites I’ve looked at and borrowed the code snippets) for writing this article

Migrations in Ruby on Rails

written September 5 2006 by
{ Kommen }
Comments 8

This is all about how to use Migrations in Ruby on rails to make your work even more productive.

I’m developing with Ruby on Rails since 8 month now, coming from Java and PHP.
But only a few days ago I discovered one powerful feature of Ruby on Rails: Migrations.

I think there are a lot of others (like I was) who develop with Rails, but don’t know how to use migrations and how helpful they are.

For those, here is a litte introduction.

This article is continued. Click to read more!

Installing Mongrel on OS X

written September 1 2006 by
{ Joe }
Comments 1

A few days ago I began working on a design for the “soaked and soaped”-blog. Webrick seemed a bit slow for working offline on an app like Typo so I decided to give mongrel a try.

After installing it via RubyGems…
$ sudo gem install mongrel

.. I quickly realized that something went wrong during installation.
I tried to start mongrel in my RailsApp directory but all that happened was getting an error message that HttpHandler doesn’t exist.

I googled a bit and finally found this.

It says that the mongrel installation routine needs a programm called ginstall to work proper. Bad luck, Mac OS X has no program called ginstall, but one which is called install and which resides on another location than ginstall.

So all you have to do, do get mongrel running on OS X is:

1. Uninstall it (if you have already installed it).
$ sudo gem uninstall mongrel

2. Set a symbolic link from the “install”-command to the place, the install script wants to have a program called “ginstall”.
$ sudo ln -s /usr/bin/install /opt/local/bin/ginstall

3. Install mongrel again via RubyGems
$ sudo gem install mongrel

4. After installation is complete, switch into your railsapp directory and start mongrel.
$ cd your/railsapp
$ mongrel_rails start

Exception Notifier - Ruby on Rails plugin

written August 31 2006 by
{ Kommen }
Comments 24

Yesterday I came over Exception Notifier.

I found it really useful because it is really easy to install and you can instantly react to Application Errors. Your customers don’t have to notify you because you get a bunch of information to track the error via email.

This article is continued. Click to read more!
You've reached the end of this page. Feel free to dig into the archives of this blog or subscribe to our newsfeed.