Even though I was researching hard, I couldn't solve it, but it was actually very easy. (My way of checking was bad)
<div id="target">Destination</div>
<%= link_to 'Transition to the destination',Transition destination path(anchor: 'target') %>
That's it!
However, it does not move like this time, It is more dynamic and longing to add animation and scroll automatically, and in that case I think that implementation using JS will be necessary, so I would like to learn that as well in the future.
** Articles that I referred to ** Specify the location (position) of the destination page using Rails anchor link Set Anchor with Rails link_to (https://qiita.com/tatsuya1156/items/595fe0df912c6c89f991)
Recommended Posts