<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>spitfire_tree</author_name>
  <author_url>https://blog.hatena.ne.jp/spitfire_tree/</author_url>
  <blog_title>happy lie, happy life</blog_title>
  <blog_url>https://spitfire-tree.hatenadiary.org/</blog_url>
  <categories>
    <anon>Rails</anon>
  </categories>
  <description>コード def if_found(obj, msg = &quot;デフォルトのエラーメッセージ&quot;, action = &quot;index&quot;, controller = controller_name) if obj yield if block_given? else flash[:error] = msg redirect_to :controller =&gt; controller, :action =&gt; action end end 使い方 まずは action_controller に上のメソッドを記述します。実際の利用方法は以下のとおり。 if_found(@item = Item.find(para…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fspitfire-tree.hatenadiary.org%2Fentry%2F20080809%2F1218269418&quot; title=&quot;if_found メソッドを本格的に考えてみる - happy lie, happy life&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://thumbnail.image.rakuten.co.jp/@0_mall/book/cabinet/3531/9784873113531.jpg?_ex=128x128</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-08-09 17:10:18</published>
  <title>if_found メソッドを本格的に考えてみる</title>
  <type>rich</type>
  <url>https://spitfire-tree.hatenadiary.org/entry/20080809/1218269418</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
