Bonjour,
j’utilise le plugin file_column pour mes uploads d’images. Quand je
teste le
dossier se créer bien mais le fichier n’est pas uploadé.
J’ai bien ajouter multipart true dans mon formulaire
Merci
ma vue
<% form_for (:enseignant,
:url => enseignants_path,
:html => {:multipart => true}) do |f| %>
Nom
<%= f.text_field :nom %>
Prenom
<%= f.text_field :prenom %>
Photo
<%= file_column_field "entry", "photo" %>
Email
<%= f.text_field :email %>
Telephone
<%= f.text_field :telephone %>
Recherche
<%= f.text_area :recherche %>
Publication
<%= f.text_area :publication %>
Personal
<%= f.text_area :personal %>
<%= submit_tag "Create" %>
<% end %>mon model
class Enseignant < ActiveRecord::Base
file_column :photo,
:root_path => File.join(RAILS_ROOT, “public/images”, “upload”),
:web_root => “upload/”
validates_file_format_of :image, :in => [“gif”, “png”, “jpg”]
# validates_filesize_of :image, :in => 15.kilobytes..1.megabyte
# validates_image_size :image, :min => "1200x1800"
end