I am trying to display an image stored in my MSSQL database in my Rails
2 application. As a test example I have written a C# application that
displays the image on a form which works. So I know the image in my
database is correct.
However when I try to retrieve the image by the following code it gives
me an rails error:
@account = Account.find(params[:id])
send_data @account.account_logo, :type => ‘image/png’, :disposition =>
The following error is returned:
NoMethodError (undefined method
unpack' for #<Array:0x15b8fc44>): c:/ruby/lib/ruby/1.8/base64.rb:59:in decode64’
binary_to_string' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/attribute_methods.rb:211:in account_logo’
send' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/attribute_methods.rb:240:in method_missing’
The following link on the internet is supposed to have the solution,
however that page doens’t exist any longer.
Any help would be appreciated.