ruby on rails - Paperclip saving files in the right folder but giving the wrong url -
here paperclip initiaizer:
paperclip.options[:command_path] = "/usr/local/bin/" paperclip::attachment.default_options[:storage] = :fog paperclip::attachment.default_options[:fog_credentials] = {:provider => "local", :local_root => "#{rails.root}/public/system"} paperclip::attachment.default_options[:fog_directory] = "" paperclip::attachment.default_options[:use_timestamp] = false
in model have:
class auto < activerecord::base has_attached_file :logo, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png", :url => "/system/cars/logo/:id/:style/:filename" validates_attachment_content_type :logo, :content_type => /\aimage\/.*\z/ end
but reasons when do: car.last.logo.url
get: http://localhost:3000/cars/logo/18/original/7450392a-5e39-11e4-9a87-bea65d182201.png
instead of http://localhost:3000/system/cars/logo/18/original/7450392a-5e39-11e4-9a87-bea65d182201.png
i don't understand i'm doing wrong.
ruby-on-rails paperclip
No comments:
Post a Comment