cpjolicoeur (owner)

Revisions

gist: 24954 Download_button fork
public
Public Clone URL: git://gist.github.com/24954.git
Embed All Files: show embed
Text #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
## FORM
 
- form_for @user, :html => { :multipart => true } do |f|
 
  ...
 
  %p
    = f.file_field :avatar
 
## MODEL
 
  has_attached_file :avatar, :styles => { :small => "150x150>", :large => "200x200>" }#,
  validates_attachment_size :avatar, :less_than => 2.megabyte
  validates_attachment_content_type :avatar, :content_type => ["images/jpeg", "image/png"]