Switching to Grid_FS, correctly

This commit is contained in:
ilya 2010-07-23 14:52:59 -07:00
parent 283bbc4850
commit 1b32afc78f
3 changed files with 9 additions and 9 deletions

View file

@ -2,7 +2,7 @@ class PhotosController < ApplicationController
before_filter :authenticate_user!
def create
begin
#begin
@photo = Photo.instantiate(params[:photo])
@photo.person = current_user
@ -16,10 +16,10 @@ class PhotosController < ApplicationController
render :action => 'album#new'
end
rescue
flash[:error] = "Photo upload failed. Are you sure that was an image?"
redirect_to Album.first(:id => params[:photo][:album_id])
end
#rescue
# flash[:error] = "Photo upload failed. Are you sure that was an image?"
# redirect_to Album.first(:id => params[:photo][:album_id])
#end
end
def new

View file

@ -4,7 +4,7 @@ class ImageUploader < CarrierWave::Uploader::Base
storage :grid_fs
def store_dir
"uploads"
"files/#{model.id}"
end
def extension_white_list

View file

@ -1,7 +1,7 @@
CarrierWave.configure do |config|
#config.grid_fs_database = "#diaspora-#{Rails.env}"
#config.grid_fs_host = 'localhost'
#config.grid_fs_access_url = "/images"
config.grid_fs_database = "#diaspora-#{Rails.env}"
config.grid_fs_host = 'localhost'
config.grid_fs_access_url = "/images"
config.storage = :grid_fs
#config.storage = :file
end