<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>shinkufencer</author_name>
  <author_url>https://blog.hatena.ne.jp/shinkufencer/</author_url>
  <blog_title>コード日進月歩</blog_title>
  <blog_url>https://shinkufencer.hateblo.jp/</blog_url>
  <categories>
    <anon>経験則</anon>
    <anon>Rails</anon>
  </categories>
  <description>before_actionでインスタンス変数を設定するとミスリードが多くなりがちなのでそれに対する話。 （記事製作時）の環境 # bin/rails -v Rails 6.0.3.1 (前提として)before_actionとは ActionControllerが提供するフィルタの機能の一種。 before_action は indexやshowなどのアクション定義をしているメソッドに対してそのメソッドを実施する前に実行するメソッドを設定することができる。 before_actionの利用例 Railsガイドでは以下のような記述が例として記載されている class ApplicationCon…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fshinkufencer.hateblo.jp%2Fentry%2F2020%2F12%2F12%2F000000&quot; title=&quot;Railsのbefore_actionで通常のインスタンス変数をセットするのは、本当にそれが最適解か考えてからやってほしい - コード日進月歩&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>2020-12-12 00:00:00</published>
  <title>Railsのbefore_actionで通常のインスタンス変数をセットするのは、本当にそれが最適解か考えてからやってほしい</title>
  <type>rich</type>
  <url>https://shinkufencer.hateblo.jp/entry/2020/12/12/000000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
