Skip to content

Instantly share code, notes, and snippets.

@kkd927
Created September 7, 2014 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkd927/ff374bde1d1949717a90 to your computer and use it in GitHub Desktop.
Save kkd927/ff374bde1d1949717a90 to your computer and use it in GitHub Desktop.
In app/models/report.rb
has_attached_file :video,
:path => ":rails_root/public/video/:id/:filename",
:url => "/video/:id/:filename",
:styles => {
:medium => { :geometry => "640x480", :format => 'mp4' },
:large => { :geometry => "1024x576", :format => 'mp4' },
},
:processors => [:ffmpeg, :qtfaststart]
validates_attachment_content_type :video, content_type: /\Avideo\/.*\Z/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment