Forum: Ruby on Rails How to make attachment_fu generate RESTFUL URL

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Rain C. (Guest)
on 2007-06-27 13:57
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
Zack C. (Guest)
on 2007-06-27 18:02
(Received via mailing list)
On 6/27/07, Rain C. <removed_email_address@domain.invalid> 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 C.
http://depixelate.com
Rain C. (Guest)
on 2007-06-27 18:46
Zack C. wrote:
> On 6/27/07, Rain C. <removed_email_address@domain.invalid> 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 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
tamouse m. (Guest)
on 2013-08-12 08:52
(Received via mailing list)
On Aug 11, 2013, at 10:17 PM, danny thyui <removed_email_address@domain.invalid> 
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.
> http://www.rasteredge.com/how-to/vb-net-imaging/th...
>
> --
> Posted via http://www.ruby-forum.com/.

Is this spam? This poster sends almost identical messages all pointing
to this site.
This topic is locked and can not be replied to.