<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>chanichiwasshoi</author_name>
  <author_url>https://blog.hatena.ne.jp/chanichiwasshoi/</author_url>
  <blog_title>プログラミングのゴミ箱</blog_title>
  <blog_url>https://chanichiwasshoi.hateblo.jp/</blog_url>
  <categories>
  </categories>
  <description>before_actionとは？ before_actionを使うことでコントローラのアクションが実行される前に別のメソッドを実行できる。 before_action :hoge def index ... end def hoge ... endこのようなコードがあったとき、indexアクションが実行される前に先にhogeが実行される。 &quot;onlyオプション&quot;onlyオプションを付けることで特定のアクションのときにだけメソッドを実行できる。 before_action :hoge, only; [:fuga1, :fuga2] def fuga1 ... end def fuga2 ... …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchanichiwasshoi.hateblo.jp%2Fentry%2F2022%2F03%2F01%2F211414&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>2022-03-01 21:14:14</published>
  <title>railsのbefore_actionについて解説</title>
  <type>rich</type>
  <url>https://chanichiwasshoi.hateblo.jp/entry/2022/03/01/211414</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
