Home > ruby > Ruby Mobile Browser Detector (port of JMBD)

Ruby Mobile Browser Detector (port of JMBD)

I have successfully ported Java Mobile Browser Detector to ruby. I am sure there are other existing utilities to achieve this but I found this to more simpler to understand and use. It works well with my mobile site Fundu.mobi developed on rails. I though it would be useful for someone so here is the code rmbd.zip.

Here is how you can use it in any controller


class SampleController < ApplicationController
    def index
      device_config = DeviceConfigDetector.detect_capabilities_for_request(request);
      logger.debug("device config = #{device_config.inspect}")
    end
end

ruby ,

  1. No comments yet.
  1. No trackbacks yet.