문제

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?

도움이 되었습니까?

해결책

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
  ...
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top