Domanda

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?

È stato utile?

Soluzione

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
  ...
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top