Created
December 9, 2010 22:16
-
-
Save kevinpfromnm/735426 to your computer and use it in GitHub Desktop.
paperclip image example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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