ProjectX Technology » Made from New Zealand

By: Projectx Technology  06-Dec-2011

ProjectX Technology » Made from New Zealand

We could try something like this: ':country', :controller => :locations, :action => :show,
 :country =>'|'))
map.region ':country/:region', :controller => :locations, :action => :show,
 :country =>{|c| "^#{}" }.join('|'))
# /lib/routing_extensions.rb
module ThongKuah
module Routing

  module RouteExtensions
    def self.included(base)
      base.alias_method_chain :recognition_conditions, :path_regexp

  # allows recognition for paths only matching the given regexp (conditions[:path])
  # allows recognition for paths not matching the given regexp (conditions[:not_path])
    def recognition_conditions_with_path_regexp
      result = recognition_conditions_without_path_regexp
      result << "conditions[:path] =~ path" if conditions[:path]
      result << "(conditions[:not_path]=~path).nil?" if conditions[:not_path]


# /config.environment.rb
require 'route_extension'
ActionController::Routing::Route.send :include, ThongKuah::Routing::RouteExtensions

So now we can go : ':country', :controller => :locations, :action => :show,
 :conditions => {:path =>'|'))}
map.region ':country/:region', :controller => :locations, :action => :show,
 :conditions => {:path =>{|c| "^#{}" }.join('|')) }

Note we can have negative matches as well. I’m sure the Regular expressions gods can do a negative match use Regexp only, but hey.

Contact Projectx Technology


Print this page

Other products and services from Projectx Technology


ProjectX Technology » Flash API

This allows the map to be controlled similar to what is found in Google Earth, but with simple tiled maps, rather than complex terrain. Google has just released their new version of their Google Maps Flash API, the big feature in this is their 3D map view perspective.


ProjectX Technology » All Posts

For service companies, creating a common build process with bunding and image spriting will become a small incremental cost that can be re-applied across all your clients. I would have loved to give a talk on advanced web performance techniques like Varnish and Edge Side Includes or how to handle 10K requests a second on a VM. Just as we have moved on from those designs to better designs, we need to progress web performance to next level in NZ.


ProjectX Technology » Australia

The big question is will they be doing the haka before kick-off. Go the Codeblacks, do us proud.


ProjectX Technology » Business

I spent a bit of time over the Xmas break using the iPhone for reading webpages. I discovered how really sucky browsing webpages from a mobile device is. Please Google can you integrate Google Reader and Fast Flip.


ProjectX Technology » Google Maps

On the page load event, create a new Mapsicle object, with the first param being the id of the container ‘div’ element,and the second being the init a GLatLng object for the inital location. Advanced Store locators – Create store locators showing you exactly how to get to your store from their current location. Interactive tours – Combine Street View with content to show people interactive tours of the streets of the world.


ProjectX Technology » mapping

Version 3 is still in it’s early days in Google Labs, however it is already showing exciting features and improvements, as well as a much better code structure. Although there is still a wee way before this API is ready for serious use, it should be a good step forward when it’s ready.