<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ohbarye</author_name>
  <author_url>https://blog.hatena.ne.jp/ohbarye/</author_url>
  <blog_title>valid,invalid</blog_title>
  <blog_url>https://ohbarye.hatenablog.jp/</blog_url>
  <categories>
    <anon>Ruby on Rails</anon>
  </categories>
  <description>View でちょっと頑張る必要があり Controller から render_to_string で文字列を得てから JSON に突っ込むようなエンドポイントがあるとする。 # controller/books_controller.rb class BooksController # GET /book/:id def show @book = Books.find! params[:id] render json: { book: render_to_string(:show), meta: @book.meta, } end end # view/books/show.erb &lt;%= …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fohbarye.hatenablog.jp%2Fentry%2F2017%2F08%2F25%2F003603&quot; title=&quot;Controller spec で render_to_string の結果が empty string になる - valid,invalid&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>2017-08-25 00:36:03</published>
  <title>Controller spec で render_to_string の結果が empty string になる</title>
  <type>rich</type>
  <url>https://ohbarye.hatenablog.jp/entry/2017/08/25/003603</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
