{"id":282,"date":"2020-10-14T12:40:28","date_gmt":"2020-10-14T03:40:28","guid":{"rendered":"https:\/\/tech.aoiblog.net\/?p=282"},"modified":"2020-10-14T12:49:13","modified_gmt":"2020-10-14T03:49:13","slug":"%e3%80%90rails%e3%80%91url%e7%9b%b4%e6%89%93%e3%81%a1%e9%98%b2%e6%ad%a2%e3%81%ae%e5%ae%9f%e8%a3%85","status":"publish","type":"post","link":"https:\/\/tech.aoiblog.net\/?p=282","title":{"rendered":"\u3010Rails\u3011URL\u76f4\u6253\u3061\u9632\u6b62\u306e\u5b9f\u88c5"},"content":{"rendered":"\n<p>\u3053\u3093\u306b\u3061\u306f\u3001\u3042\u304a\u3044\uff08<a href=\"https:\/\/twitter.com\/aoi_programming\">@aoi_programmer<\/a>\uff09\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f\u3001\u7279\u5b9a\u306e\u30e6\u30fc\u30b6\u30fc\u4ee5\u5916\u304c\u7de8\u96c6URL\u306a\u3069\u3092\u76f4\u6253\u3061\u3057\u3066\u3082\u3001\u5165\u308c\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"b\">\u3010Rails\u3011URL\u76f4\u6253\u3061\u3068\u306f<\/h2>\n\n\n\n<p>\u76f4\u63a5URL\u3092\u6253\u3061\u8fbc\u3080\u3053\u3068\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u5bfe\u7b56\u3092\u3057\u3066\u3044\u306a\u3044\u3068\u3001\u4ed6\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u81ea\u5206\u306e\u30da\u30fc\u30b8\u3092\u7de8\u96c6\u30fb\u66f4\u65b0\u30fb\u524a\u9664\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"b\">\u89e3\u6c7a\u7b56<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>def edit\n    @item = Item.find(params&#91;:id])\n    unless user_signed_in? &amp;&amp; (current_user == @item.user)\n      redirect_to root_path\n    end\n  end<\/code><\/pre>\n\n\n\n<p>\u73fe\u5834\u304b\u3089\u306f\u4ee5\u4e0a\u3067\u3059.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u3042\u304a\u3044\uff08@aoi_programmer\uff09\u3067\u3059\u3002 \u4eca\u56de\u306f\u3001\u7279\u5b9a\u306e\u30e6\u30fc\u30b6\u30fc\u4ee5\u5916\u304c\u7de8\u96c6URL\u306a\u3069\u3092\u76f4\u6253\u3061\u3057\u3066\u3082\u3001\u5165\u308c\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u3044\u304d\u307e\u3059\u3002 \u3010Rails\u3011URL\u76f4\u6253\u3061\u3068\u306f \u76f4\u63a5URL\u3092\u6253\u3061\u8fbc\u3080\u3053\u3068\u3002 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":99,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/posts\/282"}],"collection":[{"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=282"}],"version-history":[{"count":11,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/posts\/282\/revisions"}],"predecessor-version":[{"id":294,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/posts\/282\/revisions\/294"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=\/wp\/v2\/media\/99"}],"wp:attachment":[{"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.aoiblog.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}