LoginSignup
12
13

More than 5 years have passed since last update.

確認画面がある場合のcarriewaveで画像アップロード

Last updated at Posted at 2016-05-01

new→confirmation→completeとアクションを移動するイメージ

確認画面のview (confirmation.html.erb)

#確認画面用の画像
<%= image_tag(@user.image.url) %>
#キャッシュファイル名を渡す
<%= hidden_field_tag :"cache[image]", @user.image.cache_name %>

送信画面 (コントローラー内のcompleteアクション)

#キャッシュから画像を復元する
@user.image.retrieve_from_cache! params[:cache][:image]
@user.save!
12
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
13