Sha256: 52c680f43bef63403581c60ca8a086135051134856fe36063948c474d9553c0b
Contents?: true
Size: 1.99 KB
Versions: 2
Compression:
Stored size: 1.99 KB
Contents
= Attached Attached is a Ruby on Rails file attachment tool that lets users upload to the cloud, then process in the cloud. The tool supports Amazon S3 by default. It surpasses Paperclip by providing built-in support for direct uploads to the cloud and by allowing integration with cloud based processing tools. However, in almost every other way Paperclip is better. The source code is inspired (and copied) from Paperclip. If you aren't working in the cloud exclusively then this isn't for you! == Installation gem install attached == Examples Migration: class CreateVideo < ActiveRecord::Migration def self.up create_table :videos do |t| t.string :encoding_identifier t.string :encoding_extension t.integer :encoding_size t.timestamps end end def self.down drop_table :videos end end Model: has_attached :encoding, :styles => { :mp4_720p => { :extension => '.mp4' }, :mp4_480p => { :extension => '.mp4' }, :ogg_720p => { :extension => '.ogv' }, :ogg_480p => { :extension => '.ogv' }, } after_save do remote.encode(self.encoding.url) end Form: <%= form_for @video, :html => { :multipart => true } do |form| %> <%= form.file_field :encoding %> <p class="errors"><%= @video.errors[:encoding] %></p> <% end %> View: <video> <source src="<%= @video.encoding.url(:mp4_480p) %>" /> <source src="<%= @video.encoding.url(:ogg_480p) %>" /> </video> == Advanced === Storage has_attached :avatar, :provider => :amazon, :credentials => { :secret_access_key => "*****", :access_key_id => "*****", } has_attached :avatar, :provider => :google, :credentials => { :secret_access_key => "*****", :access_key_id => "*****", } === Processor has_attached :avatar, :processor => :resize, :styles => { :small => { :size => "200x200#" } :large => { :size => "200x200#" } } == Copyright Copyright (c) 2010 Kevin Sylvestre. See LICENSE for details.
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
attached-0.1.1 | README.rdoc |
attached-0.1.0 | README.rdoc |