{"comment":{"url":"https://api.github.com/repos/qpmayochan/protospace/comments/13819237","html_url":"https://github.com/qpmayochan/protospace/commit/f91f1fc8cdd98ff9f0c35e224f9679531f75c7f0#commitcomment-13819237","id":13819237,"user":{"login":"saino-katsutoshi","id":12888685,"avatar_url":"https://avatars.githubusercontent.com/u/12888685?v=3","gravatar_id":"","url":"https://api.github.com/users/saino-katsutoshi","html_url":"https://github.com/saino-katsutoshi","followers_url":"https://api.github.com/users/saino-katsutoshi/followers","following_url":"https://api.github.com/users/saino-katsutoshi/following{/other_user}","gists_url":"https://api.github.com/users/saino-katsutoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/saino-katsutoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saino-katsutoshi/subscriptions","organizations_url":"https://api.github.com/users/saino-katsutoshi/orgs","repos_url":"https://api.github.com/users/saino-katsutoshi/repos","events_url":"https://api.github.com/users/saino-katsutoshi/events{/privacy}","received_events_url":"https://api.github.com/users/saino-katsutoshi/received_events","type":"User","site_admin":false},"position":5,"line":18,"path":"app/controllers/prototypes_controller.rb","commit_id":"f91f1fc8cdd98ff9f0c35e224f9679531f75c7f0","created_at":"2015-10-16T15:09:20Z","updated_at":"2015-10-16T15:09:20Z","body":"private下にset_prototypeというメソッドを定義してbefore_actionで呼びます。\r\n```\r\ndef set_prototype\r\n  @prototype = Prototype.find(params[:id])\r\nend\r\n```\r\nみたいな感じで定義してあげます。before_action set_prototype, only: [:edit, :update]とかで"}}