{"published":"2008-08-09 17:10:18","width":"100%","height":"190","author_url":"https://blog.hatena.ne.jp/spitfire_tree/","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fspitfire-tree.hatenadiary.org%2Fentry%2F20080809%2F1218269418\" title=\"if_found \u30e1\u30bd\u30c3\u30c9\u3092\u672c\u683c\u7684\u306b\u8003\u3048\u3066\u307f\u308b - happy lie, happy life\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://spitfire-tree.hatenadiary.org/","url":"https://spitfire-tree.hatenadiary.org/entry/20080809/1218269418","type":"rich","provider_url":"https://hatena.blog","blog_title":"happy lie, happy life","categories":["Rails"],"provider_name":"Hatena Blog","image_url":"https://thumbnail.image.rakuten.co.jp/@0_mall/book/cabinet/3531/9784873113531.jpg?_ex=128x128","title":"if_found \u30e1\u30bd\u30c3\u30c9\u3092\u672c\u683c\u7684\u306b\u8003\u3048\u3066\u307f\u308b","description":"\u30b3\u30fc\u30c9 def if_found(obj, msg = \"\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\", action = \"index\", controller = controller_name) if obj yield if block_given? else flash[:error] = msg redirect_to :controller => controller, :action => action end end \u4f7f\u3044\u65b9 \u307e\u305a\u306f action_controller \u306b\u4e0a\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002\u5b9f\u969b\u306e\u5229\u7528\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3002 if_found(@item = Item.find(para\u2026","author_name":"spitfire_tree"}