The question is: What are you building? Do you want it to be a SPA(Single Page Application)?
If answer is yes, you can go with any popular JS framework. Three most popular these days are: React, Angular and Vue. All three are great, so it's only about personal preference. This way, you'd be building an API with Rails and later accessing it in your SPA.
If answer is no you can render your app on server using some templating engine which is compatible with Rails environment. My advice to you is to google those and see what you like the most.