0
class Video < ActiveRecord::Base
  attr_accessible :name
  attr_accessible :vi
has_attached_file :vi, :whiny => false,
    :url => "/uploads/videos/:id/:style/:basename.:extension",
    :path => ":rails_root/uploads/videos/:id_partition/:style/:basename.:extension",   
    :styles => { 
    :medium => { :geometry => "640x480", :format => 'flv' },
    :thumb => { :geometry => "100x100#", :format => 'jpg', :time => 10 }
   }

  validates_attachment_presence :vi
end

然后在我看来,我用来展示视频

<%= video_tag vid.vi.url , :size => "320x240", :controls => true%>

但视频无法显示。我写的是正确的网址吗?如何显示我设计的路径中的视频?任何人都可以帮忙吗?欣赏!

4

1 回答 1

0

尝试使用video_path而不是 video_tag。

于 2013-03-22T16:38:36.403 回答