Embedding a controller view within another controller view (along with embedded js files)

In my rails app I have a controller view, users#show. I’d like to render
a
different controller view either as an iframe or as a partial within
users#show. Let’s say it is pages#somepage (the controller simply
returns
an html view, no other processing or actions are performed).

However inside of the html code that’s returned are references to a
bunch
of javascript files. They themselves link to other js files. I have not
been able to link against them. Does anybody have suggestions?

Here’s what I tried so far

  • putting the files in the controller folder didn’t work
  • using the public folder does work but it exposes the files to
    unauthenticated users and i want to avoid that