<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ayato0211</author_name>
  <author_url>https://blog.hatena.ne.jp/ayato0211/</author_url>
  <blog_title>(define -ayalog '())</blog_title>
  <blog_url>https://ayato.hateblo.jp/</blog_url>
  <categories>
    <anon>Rails</anon>
  </categories>
  <description>ハマったのはこんなコードを書いていたから. def authorize user = User.find_by_id(login_user_id) unless user redirect_to root_path end if not user.registered redirect_to register_users_path end end よくあるユーザー認証メソッドだと思う. 期待した動作はこう. まず, user が存在しない場合 nil なので root_path へリダイレクトする. user が存在しているが, 情報が登録されていない場合, register_user_pat…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fayato.hateblo.jp%2Fentry%2F20140110%2F1389280392&quot; title=&quot;Rails の redirect_to でハマった - (define -ayalog &amp;#39;())&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>2014-01-10 00:13:12</published>
  <title>Rails の redirect_to でハマった</title>
  <type>rich</type>
  <url>https://ayato.hateblo.jp/entry/20140110/1389280392</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
