Forum: Italian Ruby user group acts as attachment

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bc5a89955ee201026441d07d1024cc24?d=identicon&s=25 stb (Guest)
on 2007-05-01 11:44
(Received via mailing list)
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
Ml@lists.ruby-it.org
http://lists.ruby-it.org/mailman/listinfo/ml
This topic is locked and can not be replied to.