是否有可能以某种方式实现,以便在加载图片后立即出现,以便您可以立即使用 jcrop 对其进行编辑
var uploadify_script_data = {};
$('#uploadify').uploadify({
uploader : '/assets/uploadify.swf',
script : '<%=pictures_path%>',
cancelImg : '/images/cancel.png',
auto : true,
multi : true,
removeCompleted : true,
scriptData : uploadify_script_data,
onComplete : function(event, ID, fileObj, doc, data){
}
});
我尝试了这段代码,但它给出了 405
def create
render json: {image_path: image.file_path}
@restaurant = current_user.restaurants.build(restaurant_params)
if @restaurant.save
flash[:success] = 'Поздравляем! Ваше заведение создано!'
redirect_to restaurant_profile_index_path
else
render 'new'
end
end
def restaurant_params
params.require(:restaurant).permit(:image)
end
我没有找到它。站点
uploadify
使用了一些选项。您可能使用的是旧版本。但总的来说,我们对onUploadSuccess事件感兴趣。
结果应该是这样的:
要使其工作,您需要:
<img id="uploaded_container" src="">
图片控制器: