Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
14
Help us understand the problem. What is going on with this article?
@mana-bin

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

More than 3 years have passed since last update.

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!
14
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
mana-bin
株式会社entershareの代表 一緒に会社を大きくしてくれる仲間募集中!
entershare
株式会社entershareはマッチングサイトやSNSなどのウェブサイトの制作・保守を得意とする会社です。「納品しない」「営業が仕様を決めない」「共同開発」などのイマドキの受託開発でお客様のサービス開発をお手伝いしてます。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
14
Help us understand the problem. What is going on with this article?