CardReader Rhomobile example

I have an application that will reader credit cards and am trying to implement that functionality in Ruby using the CardReader module. According to the documentation (, "By default the Ruby Object 'CardReader' will exist on the current page and can be used to interact directly with the CardReader". However when I run the application, and get to the point of enabling the reader, I get this error:

"e.message""uninitialized constant Controller::CardReader"

In my erb file I am using an ajax call to enable the CardReader:

  function enableScanner() {

    $.get('/app/Order/enable_cardReader', {});


In my controller I am attempting to enable the CardReader:

  def enable_cardReader



      CardReader.pinTimeout = '30000';

      CardReader.pinEntry = 'OFF';

      CardReader.readEvent = url_for(:action => :cardReader_callback)

    rescue Exception => e

      puts e.message



Does anyone have a working example of how to use the CardReader funtionality?

Thank you.