Attachment_fu file deletion

I was wondering if there was a built in function for deleting non-image
files?

On 6/27/07, Daniel G [email protected] wrote:

I was wondering if there was a built in function for deleting non-image
files?

The attachment model gets callbacks for removing thumbnails and the
actual file:

http://bs.techno-weenie.net/!source/2923/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb#72

So, delete the model and it should clean up the file(s) for you.


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com

Sorry, I’m new to rails…
When you say model, do you mean the database entry?

Ok thanks, I got it

th8254 wrote:

Ok thanks, I got it

Guess I don’t; I have this link:
<%= link_to “delete”, { :action => “delete” }, :confirm => “Are you
sure?” %>
but when I click on it leads me to a blank page
http://localhost:3000/files/delete

The action looks like this:
def delete
@user.file.destroy
flash[:notice] = ‘Your file has been deleted.’
redirect_to hub_url
end

Thanks, took a second look at my routes and found the error

On 6/27/07, th8254 [email protected] wrote:

The action looks like this:
def delete
@user.file.destroy
flash[:notice] = ‘Your file has been deleted.’
redirect_to hub_url
end

That’s a problem with your routes or your controller, not
attachment_fu. Look at your logs and see why it’s a blank screen.


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs