Attachement_fu error when updating existing photos


I am attempting to replace an exiting photo with a new one uploaded by
the user. I am using attachment_fu and I am coming up with the
following exception:

can’t convert nil into String

join' /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/file_system_backend.rb:23:infull_filename’
temp_paths' /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:354:inuploaded_data=’

My ruby code:
<% form_for(@photo) do |f| %>
<%= f.error_messages %>

<%= image_tag(@photo.public_filename, :BORDER=>0) %>

Upload new photo: <%= f.file_field :uploaded_data %> <%= f.submit 'Update' %>

<% end %>

My rails code:
def edit
@photo = Photo.find(params[:id])

def update
@photo = Photo.find(params[:id])

if @photo.update_attributes(params[:photo])
flash[:notice] = ‘Photo was successfully updated.’
redirect_to(’/listingHome/active/edit/’ + @photo.lisitng_id)

Method failing in attachement_fu

Gets the full path to the filename in this format:

# This assumes a model name like MyModel

# public/#{table_name} is the default filesystem path


Overwrite this method in your model to customize the filename.

The optional thumbnail argument will output the thumbnail’s filename.

def full_filename(thumbnail = nil)
file_system_path = (thumbnail ? thumbnail_class :
File.join(RAILS_ROOT, file_system_path,

Anybody have an idea what I am doing wrong?

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