Archive for July, 2008

Wee Date Picker Rails Plugin

July 18th, 2008 by pyrat

After a bit of a sabbatical here is another plugin for you to feast on.

This is a super simple datepicker for your rails apps. It is essentially just a packaged version of DatePicker v2.9 by frequency-decoder.com with rails helpers for easy integration.

Install

If you install the plugin using git the installer should run and the files will be copied across recursively to your public directory.

Example

In the head section of the layout.

<%= yield :date_includes %>

In the template.

<%= load_date_picker %>

Then for each date field you need to do the following. Remember: field_names have to be unique on your page.

<%= date_picker :start_date, Date.today %>

Where the first argument is the field_name and the second is the initial value. This must be a date object.

This is a tiny plugin which needs a bit of work but hopefully it helps. It is available on the github project page

Update: I wrote the installer script myself.

Rails Gotcha ActionController::MethodNotAllowed

July 14th, 2008 by pyrat

Turns out that sometimes with Mongrel less than 1.1.5 routes are not being resolved properly with Rails 2.1. (Experienced on OSX)

To fix the problem I upgraded mongrel.

sudo gem update mongrel

Would be nice to know how widespread this problem is. This link talks about this same issue in the comments. The main post is a little confused however.

Orienteering Route Choice with GIS

July 11th, 2008 by pyrat

orienteering map

I read an interesting article on how some students in Sweden did a project on calculating route choice using GIS from an orienteering map.

After reading through it, it looks as if they have been pretty successful. It would have been interesting for them to get runners to run the routes and compare them with a human route choice.

Further down the line this could be interesting if the orienteering map was held in some sort of digital device. It could calculate the optimum route in real time and then use GPS to direct you along this route. Turning super technical orienteering into a string course that take the optimum route with respect to contours, terrain run-ability and road options.

In the coming years it will be a challenge to maintain the challenge of orienteering with advances in navigation technology. Formula 1 restrictions will no doubt come into force.

Read the article