<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>bake0937</author_name>
  <author_url>https://blog.hatena.ne.jp/bake0937/</author_url>
  <blog_title>Beeeat’s log</blog_title>
  <blog_url>https://bake0937.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>Ruby on Rails</anon>
    <anon>小ネタ</anon>
    <anon>SEO</anon>
  </categories>
  <description>SEOチームから URL の末尾にはスラッシュを付けて欲しいという依頼を対応した時に文字連結とかでゴニョゴニョしようとしたが，Rails で用意されている機能で簡単にできることがわかったのでメモしておく． やり方 とても簡単でroutes.rbでルーティングの設定の最後にtrailing_slash: trueをつければ良い． これで URL の末尾にスラッシュが付くようになる． # routes.rb get '/hoge/:id', to: 'hoge#show', trailing_slash: true まとめと所感 今回は Rails で URL の末尾にスラッシュを付ける方法につい…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbake0937.hatenablog.com%2Fentry%2F2020%2F09%2F14%2F082417&quot; title=&quot;Rails で URL の末尾にスラッシュを付ける方法 - Beeeat’s log&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-09-14 08:24:17</published>
  <title>Rails で URL の末尾にスラッシュを付ける方法</title>
  <type>rich</type>
  <url>https://bake0937.hatenablog.com/entry/2020/09/14/082417</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
