{"action":"closed","issue":{"url":"https://api.github.com/repos/TakezoMiyamoto/thalia/issues/7","repository_url":"https://api.github.com/repos/TakezoMiyamoto/thalia","labels_url":"https://api.github.com/repos/TakezoMiyamoto/thalia/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/TakezoMiyamoto/thalia/issues/7/comments","events_url":"https://api.github.com/repos/TakezoMiyamoto/thalia/issues/7/events","html_url":"https://github.com/TakezoMiyamoto/thalia/issues/7","id":361532394,"node_id":"MDU6SXNzdWUzNjE1MzIzOTQ=","number":7,"title":"User アバター画像を登録できるようにする","user":{"login":"TakezoMiyamoto","id":12445452,"node_id":"MDQ6VXNlcjEyNDQ1NDUy","avatar_url":"https://avatars0.githubusercontent.com/u/12445452?v=4","gravatar_id":"","url":"https://api.github.com/users/TakezoMiyamoto","html_url":"https://github.com/TakezoMiyamoto","followers_url":"https://api.github.com/users/TakezoMiyamoto/followers","following_url":"https://api.github.com/users/TakezoMiyamoto/following{/other_user}","gists_url":"https://api.github.com/users/TakezoMiyamoto/gists{/gist_id}","starred_url":"https://api.github.com/users/TakezoMiyamoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakezoMiyamoto/subscriptions","organizations_url":"https://api.github.com/users/TakezoMiyamoto/orgs","repos_url":"https://api.github.com/users/TakezoMiyamoto/repos","events_url":"https://api.github.com/users/TakezoMiyamoto/events{/privacy}","received_events_url":"https://api.github.com/users/TakezoMiyamoto/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-19T00:29:56Z","updated_at":"2018-09-21T03:44:50Z","closed_at":"2018-09-21T03:44:50Z","author_association":"OWNER","body":"0. 前提として、Homebrew で project内でimagemagickをインストールする\r\n```\r\nbrew install imagemagick\r\n```\r\n1. Carrerwaveを使ってS3に保存する。\r\nhttps://qiita.com/junara/items/1899f23c091bcee3b058#s3%E3%83%90%E3%82%B1%E3%83%83%E3%83%88%E4%BD%9C%E6%88%90\r\n\r\n- 必要gemのインストール\r\n```\r\n# for image uploader with AWS S3\r\ngem 'carrierwave'\r\ngem 'fog'\r\ngem 'mini_magick'\r\n```\r\n2. apprication controller で deviseにわたすパラメータを追記\r\n```\r\nclass ApplicationController < ActionController::Base\r\n  protect_from_forgery with: :null_session\r\n  before_action :configure_permitted_parameters, if: :devise_controller?\r\n\r\n  protected\r\n\r\n    def configure_permitted_parameters\r\n      # sign_inのときに、username, avatarも許可する\r\n      devise_parameter_sanitizer.permit(:sign_in, keys: [:username])\r\n      devise_parameter_sanitizer.permit(:sign_in, keys: [:avatar])\r\n      # sign_upのときに、username, avatarも許可する\r\n      devise_parameter_sanitizer.permit(:sign_up, keys: [:username])\r\n      devise_parameter_sanitizer.permit(:sign_up, keys: [:avatar])\r\n      #  account_updateのときに、username, avatarも許可する\r\n      devise_parameter_sanitizer.permit(:account_update, keys: [:username])\r\n      devise_parameter_sanitizer.permit(:account_update, keys: [:avatar])\r\n\r\n    end\r\n\r\nend\r\n```\r\n3. avatar uploaderの編集\r\n\r\n4. carrierwave.rb の編集\r\n\r\n\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"TakezoMiyamoto"}}