Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
attachment_fu plugin
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
bmcc  
View profile  
 More options Oct 22, 1:40 pm
From: bmcc <barry.mcca...@gmail.com>
Date: Thu, 22 Oct 2009 10:40:35 -0700 (PDT)
Local: Thurs, Oct 22 2009 1:40 pm
Subject: attachment_fu plugin
Hello Everyone,

I have been slowly getting stronger with ruby and rails, but ofcourse
the deeper I dig the more problems arrise.

I have been using the plugin attachment_fu to handle uploading,
thumbnail creation, and re-sizing of images. I created a scaffold and
for a model called VillaPic (added has_attachment). I didnt touch the
code in the edit action. When I upload a VillaPic I have attachment_fu
create a thumnail with the same name as the original file with _thumb
appended to the end. My issue is when I change (action => 'edit') the
name of the main file and hit update it does not update the
thumbnail's name to reflect the changes unless I pretend to edit the
file again and hit update without actually changing anything.

I tried to call these functions in the controller an the model but I
am having a problem with the parameters and such so I dont even know
if Im headed in the right direction: find_or_initialize_thumbnail
(file_name_suffix) and create_or_update_thumbnail(temp_file,
file_name_suffix, *size). I was just wondering if anyone ever had an
issue in this area and how you solved it.

I didnt post any code because everything is working fine but this so
there really isnt nothing to analyze. If you have ran accross this
issue with attachment_fu Im sure you will know what Im talking about
without any code. If not thats cool, maybe you might want to check out
the plugin when you have some free time.

Thanks,

Barry


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Greg Pederson  
View profile  
 More options Oct 22, 3:17 pm
From: Greg Pederson <greg.peder...@gmail.com>
Date: Thu, 22 Oct 2009 15:17:09 -0400
Local: Thurs, Oct 22 2009 3:17 pm
Subject: Re: [ORUG] attachment_fu plugin

Is the name field being created by the plugin or in the new form?  If it's
created by the plugin maybe make sure your model/controller code isn't
taking precedent over the plugin edit functionality....just a thought.  You
may need to declare the name attribute in your model???
attr_accessible :name

Just a long shot guess.

If you can't work it out or find yourself spending too much time you might
consider using paperclip as it's really easy to integrate...IMHO

http://ruby-toolbox.com/categories/rails_file_uploads.html

Greg

--
Greg Pederson
Founder and Technical Director

407-641-0327 office

@gregpederson twitter
Nsight Development, LLC.
www.NsightDevelopment.com

Quis custodiet ipsos custodes


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anthony Eden  
View profile  
 More options Oct 22, 3:20 pm
From: Anthony Eden <anthonye...@gmail.com>
Date: Thu, 22 Oct 2009 09:20:46 -1000
Local: Thurs, Oct 22 2009 3:20 pm
Subject: Re: [ORUG] Re: attachment_fu plugin
I'll second using Paperclip, if that's an option. Just keep in mind
that if you ever have any reasonable amount of traffic that uploads
files then trying to process images inline is probably not a good
idea.

Anthony

--
GMU/IT d- s: a32 C++(++++)$ UL@ P--- L+(++) !E W+++$ !N o? K? w--- !O
M++ V PS+ PE Y PGP t+ !5 X- R tv b++ DI+ D++ G- e++ h---- r+++ y++++**

http://anthony.mp


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bmcc  
View profile  
 More options Oct 25, 7:30 pm
From: bmcc <barry.mcca...@gmail.com>
Date: Sun, 25 Oct 2009 16:30:22 -0700 (PDT)
Local: Sun, Oct 25 2009 7:30 pm
Subject: Re: attachment_fu plugin
Thanks for the responses everyone.

"attr_accessible :name" didnt work. I thought it would but it didnt.
So I basically hardcoded a work-around in the update action. Since
there is only one thumbnail per picture, after I update the picture I
do a find for its thumbnail and update it with the same information.

Its not a big deal Im sure I will figure it out in due time. I am
going to checkout Paperclip on my next rails project thanks for the
heads up.

Take Care

Barry

On Oct 22, 3:20 pm, Anthony Eden <anthonye...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google