David Kimura PRO said over 6 years ago on Page Specific Javascript in Ruby on Rails :

I do think that people and companies should do what they feel is best for them. Though, the same logic can apply to just controllers. Also, you wouldn’t have to create a file for every controller and/or action, just the ones you would want PSJ.

However, I wouldn’t put the JS directly in the views for a few reasons.

In the view, the JS will not be minified or compressed.

The CDN likely won’t cache the results of the page and cause extra bandwidth and load times (minimal but still). 

You lose access to the reuse of JS.