레일 3 샘플 앱에서 CarrierWave를 사용하고 있습니다.어떻게해야합니까? CarrierWave로 원격 위치 확인이 가능합니까?
class Painting < ActiveRecord::Base
attr_accessible :gallery_id, :name, :image, :remote_image_url
belongs_to :gallery
mount_uploader :image, ImageUploader
validates :name, :presence => true,
:length => { :minimum => 5, :maximum => 100 }
validates :image, :presence => true
end
: 이것은 내 모델
CarrierWave::DownloadError in ImageController#create
trying to download a file which is not served over HTTP
입니다 : 내가 표준 오류 예외가 발생하지 않도록 사용자가 빈 여부 이미지 중 잘못된 URL을 제출하면 원격 위치에 업로드를 확인하려면
이 내 컨트롤러 : 내가 지금 어떤 통찰력이 좋은 것이 문제를 해결하는 방법을 정말 잘 모르겠어요
class PaintingsController < ApplicationController
def new
@painting = Painting.new(:gallery_id => params[:gallery_id])
end
def create
@painting = Painting.new(params[:painting])
if @painting.save
flash[:notice] = "Successfully created painting."
redirect_to @painting.gallery
else
render :action => 'new'
end
end
def edit
@painting = Painting.find(params[:id])
end
def update
@painting = Painting.find(params[:id])
if @painting.update_attributes(params[:painting])
flash[:notice] = "Successfully updated painting."
redirect_to @painting.gallery
else
render :action => 'edit'
end
end
def destroy
@painting = Painting.find(params[:id])
@painting.destroy
flash[:notice] = "Successfully destroyed painting."
redirect_to @painting.gallery
end
end
.
나는 약 갈 수있는 가장 좋은 방법은 만드는 것입니다 경우 확실 해요. –