Hi Arman

I solved my upload validation problem, the  enctype="multipart/form-
data" on the def does not work, you need multipart="true" on the form
tag.

IE. <form merge param="default" multipart="true">

Cheers
Geoff


On Mar 24, 11:13 pm, geoffd123 <[email protected]> wrote:
> Hi Arman
>
> Did you solve this as I too have the same problem and it gets worst.
>
> If ignore the missing fields and I just have the file upload box and
> submit an image I get validation errors on size, content type and
> filename all being blank, so attachment fu is not processing the
> uploaded image.  Have you found / solved this one too?
>
> Cheers
> Geoff
>
> On Mar 21, 1:56 pm, Arman <[email protected]> wrote:
>
> > Thanks for the suggestion Brett but I have the validation line as
> > well. I didn't include it above as I thought it was irrelevant.
>
> > On Mar 20, 2:13 pm, Brett Nelson <[email protected]> wrote:
>
> > > Am using attachmentfuin edge hobo, I have this right below the
> > > has_attachment line
>
> > >   validates_as_attachment
>
> > > Brett
>
> > > On Mar 20, 11:51 am, Arman <[email protected]> wrote:
>
> > > > I have a form that goes crazy when I add  has_attachment to the
> > > > related model; all the model fields disappear from the form. Somehow
> > > > has_attachment is causing field_list to return an empty table. Any
> > > > help is appreciated.
>
> > > > Thanks!
> > > > Arman
>
> > > > Model with attachment:________________________________
>
> > > > class Organization < ActiveRecord::Base
>
> > > >   hobo_model # Don't put anything above this
> > > >   fields do
> > > >     name :string
> > > >     employer_id :string
> > > >     address_line_1 :string
> > > >     address_line_2 :string
> > > >     city :string
> > > >     area_province :string
> > > >     country :string
> > > >     primary_phone :string
> > > >     fax :string
> > > >     web_site :string
> > > >     content_type :string
> > > >     filename     :string
> > > >     size         :integer
> > > >     timestamps
> > > >   end
>
> > > >   belongs_to :organization_creator, :class_name => "User", :creator =>
> > > > true
> > > >   has_many :memberships, :class_name =>
> > > > "OrganizationMembership", :dependent => :destroy
> > > >   has_many :members, :through => :memberships, :source => :user
> > > >   has_many :capabilities,  :dependent => :destroy, :accessible => true
> > > >   has_attachment :storage => :file_system, :max_size =>
> > > > 1.megabytes, :path_prefix => "public/organization_assets"
> > > > _____________________________________
>
> > > > Associated form tag:_____________________________________
> > > > <def tag="form" for="Organization" enctype="multipart/form-data">
> > > >   <form merge param="default" >
> > > >     <error-messages param/>
> > > >     <label>Choose File</label>    <input type="file" name="organization
> > > > [uploaded_data]"/>
> > > >     <field-list fields="name, address_line_1, address_line_2, city,
> > > > area_province, country, primary_phone, fax, web_site" param/> #None of
> > > > these fields show up.
> > > >     <input-many:capabilities for="Capability"/>
> > > >     <div param="actions">
> > > >       <submit label="Save" param/><or-cancel param="cancel"/>
> > > >     </div>
> > > >   </form>
> > > > </def>
> > > > _________________________________________________- Hide quoted text -
>
> > > - Show quoted text -
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to