How to make attachment_fu generate RESTFUL URL

hi folks:
I follow this article:http://clarkware.com/cgi/blosxom/2007/02/24
all goes well except the public_filename ,it return something like
“photos/0000/0001/test.jpg” ,not the expected RESTFUL URL LIKE
‘photos/1/test.jpg’,any suggestion?
My Env is Rails 1.2.3 on Ruby 1.8.6 with attachment_fu from http
://svn.techno-weenie.net/projects/plugins/attachment_fu/ by now

On 6/27/07, Rain C. [email protected] wrote:

hi folks:
I follow this article:http://clarkware.com/cgi/blosxom/2007/02/24
all goes well except the public_filename e$B!$e(Bit return something like
“photos/0000/0001/test.jpg” ,not the expected RESTFUL URL LIKE
‘photos/1/test.jpg’,any suggestion?
My Env is Rails 1.2.3 on Ruby 1.8.6 with attachment_fu from http
://svn.techno-weenie.net/projects/plugins/attachment_fu/ by now

Rain,

Override the full_filename method in your model to make the filename
whatever you want:

def full_filename(thumbnail = nil)
File.join(base_path, ‘my/restful/route’,
thumbnail_name_for(thumbnail))
end

def base_path
‘’
end

Hope this helps.


Zack C.
http://depixelate.com

Zack C. wrote:

On 6/27/07, Rain C. [email protected] wrote:

hi folks:
I follow this article:http://clarkware.com/cgi/blosxom/2007/02/24
all goes well except the public_filename e$B!$e(Bit return something like
“photos/0000/0001/test.jpg” ,not the expected RESTFUL URL LIKE
‘photos/1/test.jpg’,any suggestion?
My Env is Rails 1.2.3 on Ruby 1.8.6 with attachment_fu from http
://svn.techno-weenie.net/projects/plugins/attachment_fu/ by now

Rain,

Override the full_filename method in your model to make the filename
whatever you want:

def full_filename(thumbnail = nil)
File.join(base_path, ‘my/restful/route’,
thumbnail_name_for(thumbnail))
end

def base_path
‘’
end

Hope this helps.


Zack C.
http://depixelate.com

To Zack :
only change the full_filename doe not working.Also has to change the
route config.But I’m new to Rails, I don’t know what to do.
The tutorial article hinted me by default public_filename will return
the RESTFUL URL,and the route will reach the result.Is it the Rails
version problem or someth else?

  • RainChen

On Aug 11, 2013, at 10:17 PM, danny thyui [email protected] wrote:

I use an imaging sdk which can create thumbnails found on the internet .
Install it and it becomes a selectable processing option.Then you can
create thumbnails in your image in any program at all, including Adobe
Acrobat . Just open the images, select thumbnail,and follow the setps
given in the sdk, the task will be finished in several seconds. if you
haven’t found a good choice , you can have a try. best wishes.
VB.NET Image: Program for Creating Thumbnail from Documents and Images


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

Is this spam? This poster sends almost identical messages all pointing
to this site.