Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## 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"]
Add Comment
Please, Sign In to add comment