Gibberish and attachment_fu

Hi,

I’m trying to code something that requires UI translation. I picked up
Gibberish plugin, which (unfortunately) expands the String class in
order to implement it’s magic. That seems to conflict with
attachment_fu. I’ve run the NetBeans debugger and stepped through the
creation of my Image record and it seems that file name is set to nul
at some point after gibberish extension code has ben run.

The code for the New Image form looks like this:

<% form_for(image, :html => { :multipart => true } ) do |f| -%>

<%= "name"[:image_name] %>
<%= f.text_field :name %>

<%= "image file"[:image_file] %>
<%= f.file_field :uploaded_data %>

<%= render :partial => ‘common/meta_form’, :locals => { :item =>
image } %>

<%= f.submit button_name %>

<% end -%>

The create method in ImagesController is the default:

def create
@image = Image.new(params[:image])
respond_to do |format|
if @image.save
flash[:notice] = ‘Image was successfully created.’
format.html { redirect_to(@image) }
format.xml { render :xml => @image, :status
=> :created, :location => @image }
else
format.html { render :action => “new” }
format.xml { render :xml => @image.errors, :status
=> :unprocessable_entity }
end
end
end

And the model contains attachment_fu code:

has_attachment :content_type => :image,
:storage => :file_system,
:path_prefix => ‘public/assets/photos’,
:thumbnails => { :preview => ‘320x320>’, :thumb =>
‘100x100>’ }

validates_as_attachment

Finally, the schema for the images table looks like this:

create_table “images”, :force => true do |t|
t.string “filename”
t.integer “size”
t.integer “parent_id”
t.datetime “created_at”
t.datetime “updated_at”
t.string “content_type”
t.integer “height”
t.integer “width”
t.string “thumbnail”
end

Unfortunatly, my skills in both Ruby and Rails are fairly
underdeveloped so I can’t know for sure what is going on. Has anyone
been using Gibberish plugin in conjunction with attachment_fu? Can
anyone tell me how to make this work?

Alternatively, is there any other lightweight UI translation solution
that doesn’t involve modifying the String class?

Thanks in advance.

Branko

Hm, so it’s definitely not gibberish+attachment_fu. I’ve just created
a clean project with both plugins installed, and gibberish has not
made attachment_fu fail. I’ll try to dig deeper into my code and see
what’s causing this problem…

Branko