Switching to Grid_FS, correctly
This commit is contained in:
parent
283bbc4850
commit
1b32afc78f
3 changed files with 9 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class ImageUploader < CarrierWave::Uploader::Base
|
|||
storage :grid_fs
|
||||
|
||||
def store_dir
|
||||
"uploads"
|
||||
"files/#{model.id}"
|
||||
end
|
||||
|
||||
def extension_white_list
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue