List Info

Thread: attachment_fu file deletion




attachment_fu file deletion
country flaguser name
Germany
2007-06-27 14:43:51
I was wondering if there was a built in function for
deleting non-image
files?

-- 
Posted via http://www.ruby-forum.com
/.

--~--~---------~--~----~------------~-------~--~----~
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-talkgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: attachment_fu file deletion
user name
2007-06-27 17:02:41
On 6/27/07, Daniel G <rails-mailing-listandreas-s.net> 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 Olson
http://lighthouseapp.com

http://weblog.techno-
weenie.net
http://mephistoblog.com

--~--~---------~--~----~------------~-------~--~----~
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-talkgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: attachment_fu file deletion
country flaguser name
Germany
2007-06-27 17:23:28
Sorry, I'm new to rails...
When you say model, do you mean the database entry?

-- 
Posted via http://www.ruby-forum.com
/.

--~--~---------~--~----~------------~-------~--~----~
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-talkgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: attachment_fu file deletion
country flaguser name
Germany
2007-06-27 17:46:18
Ok thanks, I got it

-- 
Posted via http://www.ruby-forum.com
/.

--~--~---------~--~----~------------~-------~--~----~
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-talkgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: attachment_fu file deletion
country flaguser name
Germany
2007-06-27 18:42:28
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:3
000/files/delete

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

-- 
Posted via http://www.ruby-forum.com
/.

--~--~---------~--~----~------------~-------~--~----~
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-talkgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: attachment_fu file deletion
user name
2007-06-27 18:50:16
On 6/27/07, th8254 <rails-mailing-listandreas-s.net> wrote:
>
> 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:3
000/files/delete
>
> 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 Olson
http://lighthouseapp.com

http://weblog.techno-
weenie.net
http://mephistoblog.com

--~--~---------~--~----~------------~-------~--~----~
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-talkgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: attachment_fu file deletion
country flaguser name
Germany
2007-06-27 18:58:30
Thanks, took a second look at my routes and found the error

-- 
Posted via http://www.ruby-forum.com
/.

--~--~---------~--~----~------------~-------~--~----~
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-talkgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )