Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include javascript from vendor/assets/javascripts

How do you include a javascript file located in vendor/assets/javascripts in a single view file (NOT in application.js) ?

Some kind of javascript_include_tag ? Please help me with syntax

I have tried the following and it doesn't work:

  • javascript_include_tag 'respond'
  • javascript_include_tag 'respond.js'
  • javascript_include_tag 'vendor/assets/javascripts/respond'
  • javascript_include_tag 'vendor/assets/javascripts/respond.js'

Thank you

like image 412
Marco Prins Avatar asked Nov 11 '22 11:11

Marco Prins


1 Answers

<%= javascript_include_tag "your_file" %>

If you're trying to include respond.js, you could check out the respond_rails gem, which will allow you to include this in your view:

<%= respond_include_tags %>

In your views of course

like image 50
Richard Peck Avatar answered Nov 14 '22 22:11

Richard Peck