Am using attachment fu in 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>
> _________________________________________________
--~--~---------~--~----~------------~-------~--~----~
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