技術ブログ

(技術系中心)基本自分用備忘録なので、あくまで参考程度でお願いします。

redirect_toでアンカーリンク移動する方法

redirect_toでアンカーリング移動する方法

オプションのanchorを使えばページ内ジャンプ機能ができます。 めちゃ簡単です。

redirect_to hoge_path(anchor: 'description')

hogehogeはジャンプ先のidです。

#description
  .card-header
    h4 ここにリンクします
(slim記載)