Attachment_fu calling strip on FileIO

At least I seem to be doing something that is making it call the strip
method.

NoMethodError in AccountsController#create
undefined method `strip’ for
#ActionController::UploadedStringIO:0x23df0c0

photo model

class Photo < ActiveRecord::Base
belongs_to :photo_for, :polymorphic => true

has_attachment :content_type => :image,
:storage => :file_system,
:max_size => 5.megabytes
end

account controller

class AccountsController < ApplicationController

def create
@account = Account.new(params[:account])
@account.build_photo(params[:photo]) unless
params[:photo][“filename”].blank?
@user = @account.users.build(params[:user])
if @account.save

end
end
end

I can’t see anything that is wrong here, at least according to the
examples this should work. I thought it could be because of the
polymorphic association, but from the call stack it doesn’t seem that
that would be the issue.

vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:332:in
sanitize_filename' vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/file_system_backend.rb:48:infilename=’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2117:in
send' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2117:inattributes=’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2116:in
each' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2116:inattributes=’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1926:in
initialize' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/has_one_association.rb:18:innew’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/has_one_association.rb:18:in
build' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/has_one_association.rb:83:innew_record’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1693:in
with_scope' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/has_one_association.rb:83:insend’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/has_one_association.rb:83:in
new_record' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/has_one_association.rb:18:inbuild’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1114:in
send' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations.rb:1114:inbuild_photo’
app/controllers/accounts_controller.rb:8:in `create’

Thanks for any help

Here

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs