gsub error

Hi,
I am trying to display a photo on the screen which is stored as binary
data in
MS SQL2000 database.here is what i have written in controller.

def photo
   @person = Person.find(params[:id])
   send_data(@person.uploaded_data,
                :filename=>@person.filename,
                 :type => @person.content_type,
            :disposition => 'inline')

end

but when i goto http://localhost:3000/person/photo/2308
I get the following error.

private method `gsub' called for #<Array:0x47454c4>

Does anyone know how do i correct this.

Could you post your stack?

nonrecursive@gmail.com wrote:

Could you post your stack?

Here s what i get in the full trace of the application.

c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/sqlserver_adapter.rb:136:in
`binary_to_string'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/schema_definitions.rb:64:in
`type_cast'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/sqlserver_adapter.rb:83:in
`type_cast'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:1876:in
`read_attribute'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:1852:in
`method_missing'
C:/Inetpub/event/app/controllers/person_controller.rb:114:in `photo'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:1101:in
`send'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:1101:in
`perform_action_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/filters.rb:696:in
`call_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/filters.rb:688:in
`perform_action_without_benchmark'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/rescue.rb:83:in
`perform_action'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:435:in
`send'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:435:in
`process_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/filters.rb:684:in
`process_without_session_management_support'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/session_management.rb:114:in
`process'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:334:in
`process'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/dispatcher.rb:41:in
`dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/webrick_server.rb:113:in
`handle_dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/webrick_server.rb:79:in
`service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/webrick_server.rb:63:in
`dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/servers/webrick.rb:59
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in
`require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in
`new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in
`require'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/server.rb:39
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
script/server:3