Acts as attachment

Ciao,

sto provando ad usare questo plugin per gestire l’ upload di immagini
ma ho qualche problema a farlo andare. nel modello ho specificato il
sistema di storage e alcune limitazioni sui tipi di file(dovrebbe
accettare solo immagini).
Il problema è che quando provo a caricare il file con “create” mi da
validation failed: conent type is not included in the list; content
type can’t be blank ecc.

class Photo < ActiveRecord::Base
acts_as_attachment :storage => :file_system, :content_type => :image
validates_as_attachment
end

<% form_remote_tag(:url => {:controller => “picture”, :action =>
“create”,:update => “” }, :html => { :multipart => true }) do -%>

 <p><%= file_field :photo,:uploaded_data %></p>
 <p><%= submit_tag :Create %></p>

<% end -%>

def create
@photo = Photo.create! params[:photo]

     render :update do |page|
       page.alert "creato"
     end
 rescue Exception => e
     render :update do |page|
       page.alert e.to_s
     end

end_______________________________________________
Ml mailing list
[email protected]
http://lists.ruby-it.org/mailman/listinfo/ml