Ruby on Rail and Google Gadgets - Are they compatible?

Hi all,

Has anyone created a url type Gadget that hits a ruby on rails
controller? Seems that methods that process request parameters fail
before any code that I've written is reached. Am I missing something
here? Stacktrace and failing methods are included below. Thanks in
advance for any help!

James

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.include?
/opt/csw/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/cgi_ext/cgi_methods.rb:49:in
`parse_request_parameters'
/opt/csw/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/cgi_ext/cgi_methods.rb:47:in
`parse_request_parameters'
/opt/csw/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/cgi_process.rb:70:in
`request_parameters'
/opt/csw/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/request.rb:12:in
`parameters'
/opt/csw/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session_management.rb:122:in
`set_session_options_without_components'
/opt/csw/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/components.rb:178:in
`set_session_options'
/opt/csw/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session_management.rb:116:in
`process'
/opt/csw/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/dispatcher.rb:38:in
`dispatch'
/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13/lib/mongrel/rails.rb:82:in
`process'
/opt/csw/lib/ruby/1.8/thread.rb:135:in `synchronize'
/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13/lib/mongrel/rails.rb:80:in
`process'
/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13/lib/mongrel.rb:529:in
`process_client'
/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13/lib/mongrel.rb:528:in
`process_client'
/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13/lib/mongrel.rb:597:in
`run'
/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13/lib/mongrel.rb:596:in
`run'
/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13/lib/mongrel.rb:585:in
`run'
/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13/lib/mongrel.rb:909:in
`run'
/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13/lib/mongrel.rb:908:in
`run'
/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13/bin/mongrel_rails:143:in
`run'
/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13/lib/mongrel/command.rb:188:in
`run'
/opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.13/bin/mongrel_rails:247
/opt/csw/bin/mongrel_rails:18

# Returns the request (POST/GET) parameters in a parsed form where
pairs such as "customer[address][street]" /
# "Somewhere cool!" are translated into a full hash hierarchy, like
# { "customer" => { "address" => { "street" => "Somewhere cool!" } } }
def CGIMethods.parse_request_parameters(params)
  parsed_params = {}

  for key, value in params
    value = [value] if key =~ /.*\[\]$/
    unless key.include?('[') <- THIS IS WHERE THE CODE IS FAILING
      # much faster to test for the most common case first (GET)
      # and avoid the call to build_deep_hash
      parsed_params[key] = get_typed_value(value[0])
    else
      build_deep_hash(get_typed_value(value[0]), parsed_params,
get_levels(key))
    end
  end

  parsed_params
end

Thanks Keynan, I was trying to avoid changing core CGI-related code.
I wondered if there was anyone else out there using Rails with Gadets,
and if it is simply something I am doing wrong. Are you using Rails
with Gadgets?

Thanks,
James