<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>show_motto</author_name>
  <author_url>https://blog.hatena.ne.jp/show_motto/</author_url>
  <blog_title>motolog</blog_title>
  <blog_url>https://moto.hatenadiary.com/</blog_url>
  <categories>
    <anon>Rails</anon>
    <anon>開発メモ</anon>
  </categories>
  <description>Railsでサブドメインを実装した際に、本サイトとサブドメインサイト間の受け渡しで少しハマりました。サブドメインサイトにいる状態で、root_path や root_url でリンク先を指定しても、本サイトではなく、そのサブドメインのトップに飛ばされます。この記事では、url_for メソッドを利用して、サブドメインサイトと本サイト間を行き来する方法をご紹介します。 url_forでメソッド作成subdomain_url_helper を以下のように作成 module SubdomainUrlHelper def with_subdomain(subdomain) subdomain ||= …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmoto.hatenadiary.com%2Fentry%2Fsubdomain-url_for&quot; title=&quot;Railsでカスタムサブドメイン-本サイトとサブドメイン間のURL設定 - motolog&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>2013-10-05 16:55:30</published>
  <title>Railsでカスタムサブドメイン-本サイトとサブドメイン間のURL設定</title>
  <type>rich</type>
  <url>https://moto.hatenadiary.com/entry/subdomain-url_for</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
