Question

There are HTML-file that contains JavaScript code. This JavaScript code loads an image and positioning it in a certain place. If failed, a message displays.

I need to include this file in template Slim.

I can include one Slim template to another by the following:

=render 'some/path/some_pattern'

How to include HTML- file to my template Slim?

Was it helpful?

Solution

The best way to add some javascript to your slim file is either by including the javascript file using

= javascript_include_tag 'name of the file' 

or by directly adding the javascript code to your slim file, using

javascript:
  code line 1
  code line 2
  ...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top