0
이미지가 Paperclip으로 업로드되면 "Successfully Uploaded"와 같은 페이지에주의를 포함시킬 수있는 방법이 있습니까?이미지가 Paperclip으로 업로드 될 때 예고하는 방법
<div class="img-circle">
<%= profile_avatar_select(@user) %>
</div>
<%= f.input :avatar, as: :file, label: "false" %>
</div>
내 application_helper.rb
def profile_avatar_select(user)
return image_tag user.avatar.url(:medium),
id: 'image-preview',
class: 'img-responsive img-circle profile-image' if user.avatar.exists?
image_tag 'default-avatar.png', id: 'image-preview',
class: 'img-responsive img-circle profile-image'
end
및 user.rb의 :
has_attached_file :avatar, styles: { medium: '152x152#' }
validates_attachment_content_type :avatar, content_type: /\Aimage\/.*\Z/
end
:'플래시 [: 성공] = "이미지 업로드"' – 7urkm3n