Rails isn't going anywhere. JS isn't the be all, end all. It's growing and is capable of a lot, but rails is a different beast and you really can't compare them, even if there is some overlap.
Like all tech, its popularity will go down over time but a lot of the ideas will live on: Elixir in particular (which is very Ruby inspired) has more buzz in the non-Ruby community than Rails ever did.