Skip to content

Instantly share code, notes, and snippets.

@kevinpfromnm
Created December 9, 2010 22:16
Show Gist options
  • Save kevinpfromnm/735426 to your computer and use it in GitHub Desktop.
Save kevinpfromnm/735426 to your computer and use it in GitHub Desktop.
paperclip image example
<extend tag="form" for="Picture">
<old-form enctype="multipart/form-data" merge>
<field-list: fields="name,description,license,notes,image" />
</old-form>
</extend>
<extend tag="card" for="Picture">
<card>
<h5><a /></h5>
<p>
<a><img src="#{this.image.url :thumbnail}" /></a>
<view:description />
</p>
<p>
Uploaded:<br />
<view:created_at format="%B %d, %Y" /> by <you:user />.
</p>
<delete-button class="actions" />
<report-content-link />
</card>
</extend>
has_attached_file :image,
:styles => {
:original => ["1000x1000", :jpg ],
:medium => ["500x800", :jpg ],
:small => ["300x500", :jpg ],
:thumbnail => ["100x100#", :jpg ]
},
:default_style => :medium,
:storage => :s3,
:path => ":style/:id_:basename.:extension",
:s3_credentials => S3_KEYS,
:s3_headers => {'Expires' => 10.year.from_now.httpdate}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment