Forum: Italian Ruby user group acts as attachment

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
stb (Guest)
on 2007-05-01 13:44
(Received via mailing list)

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

<% 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"
     rescue Exception => e
         render :update do |page|
           page.alert e.to_s
Ml mailing list
This topic is locked and can not be replied to.