How to make attachment_fu generate RESTFUL URL

6 views
Skip to first unread message

Rain Chen

unread,
Jun 27, 2007, 5:57:34 AM6/27/07
to rubyonra...@googlegroups.com
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

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

Zack Chandler

unread,
Jun 27, 2007, 10:01:31 AM6/27/07
to rubyonra...@googlegroups.com
On 6/27/07, Rain Chen <rails-mai...@andreas-s.net> wrote:
>
> 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
>

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 Chandler
http://depixelate.com

Rain Chen

unread,
Jun 27, 2007, 10:46:00 AM6/27/07
to rubyonra...@googlegroups.com
Zack Chandler wrote:
> On 6/27/07, Rain Chen <rails-mai...@andreas-s.net> wrote:
>>
>> hi folks:
>> I follow this article:http://clarkware.com/cgi/blosxom/2007/02/24
>> all goes well except the public_filename $B!$ (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 Chandler
> 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

Ferdouse Ara

unread,
Jun 27, 2007, 11:01:45 AM6/27/07
to rubyonra...@googlegroups.com
Hi,

Please can you help me with the following:

Looking for a Ruby on Rails Developer, Salary £30K-£60K, Leicester, City
Centre

Use the latest web technology Ruby on Rails.
To develop professional web applications.
Must have written previous Rail applications.
Need the talents of a smart, experienced programmer.
Need to be attentive to detail, a team-player and responsible.
Require previous commercial experience with Ruby on Rails and dealing
with Database Schema’s to Front End Applications.

Involved with creative projects which are making them a big name in the
gaming and video industries (sony and microsoft).

Would you be interested or do you know anyone who would be interested as
there are several positions available.

I appreciate your help in this.

Ferdouse Ara
Technical Recruitment Consultant

Precision Recruitment UK Ltd
Tel +44 (0) 116 2545488
Fax +44 (0) 871 2778928
http://www.precisionrecruitment.co.uk

danny thyui

unread,
Aug 11, 2013, 11:17:21 PM8/11/13
to rubyonra...@googlegroups.com
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.
http://www.rasteredge.com/how-to/vb-net-imaging/thumbnail-creating/

Tamara Temple

unread,
Aug 12, 2013, 12:51:31 AM8/12/13
to rubyonra...@googlegroups.com
Is this spam? This poster sends almost identical messages all pointing to this site.

Reply all
Reply to author
Forward
0 new messages