Permalink
Browse files

Added a controller method that uses Image#dynamic_attachment_url to g…

…enerate a thumbnail just-in-time, before redirecting to that thumbnail's URL.
  • Loading branch information...
endymion committed Jun 7, 2012
1 parent 5a2e98f commit 08728756e1bcad4cd914b39beb39ab033b181cfc
Showing with 6 additions and 0 deletions.
  1. +6 −0 app/controllers/images_controller.rb
@@ -81,4 +81,10 @@ def destroy
format.json { head :no_content }
end
end

def thumbnail
@image = Image.find(params[:id])
redirect_to @image.dynamic_attachment_url("#{params['width']}x#{params['height']}>")
end

end

0 comments on commit 0872875

Please sign in to comment.