cannot get default_url image

276 views
Skip to first unread message

erwin

unread,
Feb 18, 2012, 3:07:34 AM2/18/12
to Paperclip Plugin
paperclip 2.6.0 / Rails 3.2.1

my Partner class has a logo attachment defined as following :

class Partner < ActiveRecord::Base
...

has_attached_file :logo,
:styles => { :medium => "300x300>",
:thumb => "100x100>" },
:default_url => "/assets/logos/nologo.png",
:path => ':rails_root/public/system/
logos/:id/:style/:basename.:extension',
:url => '/system/
logos/:id/:style/:basename.:extension'
...

in my view when I display = image_tag partner.logo.url(:thumb)
I should get the default logo ( located in /assets/images/logos/
nologo.png )
but I always get an error in the log : as the system is trying to
get the interpolated logo for the partner 7...

Started GET "/system/logos/7/thumb/" for 127.0.0.1 at 2012-02-18
08:57:00 +0100
Processing by ErrorsController#render_404 as HTML
Parameters: {"path"=>"system/logos/7/thumb"}

what's wrong ?

erwin

unread,
Feb 18, 2012, 1:44:05 PM2/18/12
to Paperclip Plugin
[SOLVED] get rid of the :path and :url ( using the standard clip
instead) and moved the default logo directly into assets/images, and
it works.... don't understand why but it works... so it was related
to :pat and :url...


changed the code to :

has_attached_file :logo,
:styles => { :medium => "300x150>",
:standard => "200x100>",
:thumb => "100x50>" },
:default_url => "/nologo.png"
Reply all
Reply to author
Forward
0 new messages