Hello everybody
I have some problems with an attachments.
I have the next model
class Profile < ActiveRecord::Base
belongs_to :user
before_create :set_default_icon
has_attached_file :icon, {
:url => "/
system/:class/:attachment/:id/:style_:basename.:extension",
:styles => {
:big => Tog::Plugins.settings(:tog_social,
"profile.image.versions.big"),
:medium => Tog::Plugins.settings(:tog_social,
"profile.image.versions.medium"),
:small => Tog::Plugins.settings(:tog_social,
"profile.image.versions.small"),
:tiny => Tog::Plugins.settings(:tog_social,
"profile.image.versions.tiny")
}}.merge(Tog::Plugins.storage_options)
has_attached_file :pdf, {
:url => "/
system/:class/:attachment/:id/:style_:basename.:extension",
:path => "/
system/:rails_root/:public/:profile/:pdfs/:id/:style/:basename.:extension"
}.merge(Tog::Plugins.storage_options)
validates_attachment_content_type :pdf, :content_type =>
[ ''application/pdf'', ''application/msword'',
''application/vnd.openxmlformats-
officedocument.wordprocessingml.document'' ],
:message => ''Asegurese que el
fichero tiene la extensión .pdf o .doc''
end
When i put validates_attachment_content_type :pdf ¿is obligatory that
i have to upload a file?
because if I only upload a photo then when i submit on my form fails
because i don''t update a pdf.
Can anyone help me?
thanks.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.