views:

330

answers:

2

I have uploaded the video into my rails application by using thoughtbot-paperclip then the video is converted into "flv" format by using ffmpeg. For your reference here I specified some of my model sample code:

model.rb:

has_attached_file :source,:styles => {:thumb => "137x85>" }

If i specified :url or :path option it doesn't worked correctly.

In my view I played my video by using the following line:

<%= @model.source.url.gsub(/\?.*/,'')%>

If i use <%= @model.source.url%>, the video is not played.

When do the puts for video url it shows me the video URL as /source/original/sample/sample.fly?22000009. I knew that the last portion is a timestamp, but i want to use <%= @model.source.url%>. What's my mistake here can any one correct me please?

+1  A: 

The Paperclip documentation says that you should be able to turn off the timestamp for Paperclip::Attachment#url by passing false as a second argument:

url(style = default_style, include_updated_timestamp = true)

For style, you probably need to specify Paperclip::Attachment.default_style (not sure about this and I don't have a system I can use for testing).

Mark Westling
A: 

I achieved desired result by calling

attachment.url( attachment.default_style, false)
LRaiz