Carrierwave gemをご覧ください。サイズ変更パーツを含め、あなたが望むものすべてを提供します。
あなたのようにリモートURLで画像をアップロードすることができます。
<%= form_for @user, html: { multipart: true } do |f| %>
<p>
<label>My Avatar URL:</label>
<%= image_tag(@user.avatar_url) if @user.avatar? %>
<%= f.text_field :remote_avatar_url %>
</p>
<% end %>
そして多分としてそれをリサイズ:あなたの答えのための
class ImageUploader < CarrierWave::Uploader::Base
version :resized do
# returns an image with a maximum width of 100px
# while maintaining the aspect ratio
# 10000 is used to tell CW that the height is free
# and so that it will hit the 100 px width first
process :resize_to_fit => [100, 10000]
end
end
おかげで、私はこの手ではない(ハードコードを実行する必要があり)をモデル化する:) – egzonszo