<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kuronekonojijikun</author_name>
  <author_url>https://blog.hatena.ne.jp/kuronekonojijikun/</author_url>
  <blog_title>jiji-techのブログ</blog_title>
  <blog_url>https://jiji-tech.hatenablog.jp/</blog_url>
  <categories>
  </categories>
  <description>コントローラーのアクションで下記のような選んだ商品と現在ログイン中のユーザーが同じか確認する記述がありました。何度も同じ記述を繰り返さないためにどうすればいいか記録していきます。 app/controllers/items_controller.rb def edit @item = current_user.items.find_by(id: params[:id]) unless @item redirect_to root_path end end def update @item = current_user.items.find_by(id: params[:id]) unless …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fjiji-tech.hatenablog.jp%2Fentry%2F2021%2F03%2F23%2F120013&quot; title=&quot;before_actionの使い方とコードの可読性の上げ方 - jiji-techのブログ&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-03-23 12:00:13</published>
  <title>before_actionの使い方とコードの可読性の上げ方</title>
  <type>rich</type>
  <url>https://jiji-tech.hatenablog.jp/entry/2021/03/23/120013</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
