There is an error in changing me: The file name of my paperclip attachment is equal to one attribute on class I, IM, the paperclip Attaching the file.
When I use "# {self.company_name}", these errors occur. I obviously do not have the "self" company in this area, when I wrote this line, then I assumed that The company's example is that I am uploading this attachment. Any idea how I can fix this? Paperclip Docs says that use ": file name" but I want to use the value of Company.company_name instead.
class company & lt; ActiveRecord :: Alliance Attains status_file in Base: company_logo, {: storage = & gt; : FTP ,: path = & gt; "/logos/#{self.company_name}" ,: url = & gt; FTP_CONFIG [: access_host] + "Logo /: file name",: ftp_servers => [[Host = & gt; FTP_CONFIG [: Host] ,: User = & gt; FTP_CONFIG [: User],: Password = & gt; FTP_CONFIG [: Pass],: Port = & gt; 21 # Optional, 21}}
Update by default
I tried to use the advice found in this post:
But now I am getting the following error when my server starts:
Undefined method paperclip: Attachment: class (nomeless error)
It seems that the syntax for interpolations has changed. Updated it and it worked. Add the following to your model or create a paperclip .bb file in config / initializers
paperclip.in Republaces: Company_name. Enclosure, Style | Attachment.instance.company_name termination
No comments:
Post a Comment