]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
Serve up paperclip attachments in a cache friendly way
[rails.git] / app / models / user.rb
index 1f8d326d5dc1c3bf9f66b5fffe3227f5595b8577..9a230898a87779160d1038cac73b1e0ef498b2a3 100644 (file)
@@ -44,9 +44,9 @@ class User < ActiveRecord::Base
   after_initialize :set_creation_time
   before_save :encrypt_password
 
-  has_attached_file :image, :styles => { :thumb => "100x100>" }, 
-    :path => "#{ATTACHMENTS_DIR}/user/image/:id/:filename",
-    :url => "/user/image/:id/:filename"
+  has_attached_file :image, 
+    :default_url => "/assets/:class/:attachment/:style.png",
+    :styles => { :large => "100x100>", :small => "50x50>" }
 
   def self.authenticate(options)
     if options[:username] and options[:password]