不知道为什么但是视频在public / system / videos / videos / 000/000 /:id文件夹中成功上传,不知道为什么视频和000加倍,但它是nvm。至少我知道成功上传的视频。
这是我的模特:
class Video < ActiveRecord::Base
#mount_uploader :file, VideosUploader
has_attached_file :video, styles: {
:medium => {
:geometry => "640x480",
:format => 'mp4'
},
:thumb => { :geometry => "160x120", :format => 'jpeg', :time => 10}
}, :processors => [:transcoder]
validates_attachment_content_type :video, content_type: /\Avideo\/.*\Z/
end
这是我的节目动作:
def show
@video = Video.find(params[:id])
end
以下是我尝试打印视频的方式:
= video_tag @video.video.url
我得到的只是黑屏。