Problemi con acts_as_attachment

salve ragazzi, so che qualcuno di voi puo aiutarmi con questo
celeberrimo
plugin.

il problema è che non mi genera nessuna thumbnail dell’immagine passata
come
parametro… la salva correttamente ma niente thumb
MODEL
class Photo < ActiveRecord::Base
acts_as_attachment :storage => :file_system,
:thumbnails => { :normal => ‘300>’, :thumb =>
‘50’ }
validates_as_attachment
end

CONTROLLER
class PhotoController < ApplicationController

def create
@photo = Photo.create! params[:photo]
redirect_to :action => ‘show’, :id => @photo
rescue ActiveRecord::RecordInvalid
render :action => ‘new’
end
end

VIEW
<% form_for :photo, :url => { :action => ‘create’ }, :html => {
:multipart
=> true } do |f| -%>

<%= f.file_field :uploaded_data %>

<%= submit_tag :Create %>

<% end -%>

si comporta come se l’opzione :thumbnail non ci sia… :frowning: :frowning:


everything has got to end sometime we were satellites drifting off into
space
vega 4 - burn and fade away

On ven, 2007-06-01 at 18:03 +0200, tarini wrote:

end
end

Guarda l’ho presa dagli archivi del supporto tecnico non so se sia
pertinente col tuo problema:

Linea 142
vendor/plugins/acts_as_attachment/lib/technoweenie/acts_as_attachment/instance_methods.rb

sostituisci con (parent_id.nil? || parent_id == 0)

Se ho ben capito il problema e’ che prima di generare la thumbnail
verifica che il campo parent_id sia NULL ma in realta’ di default viene
inizializzato a 0