我在让这个嵌入式 Ruby 工作时遇到问题:
<%= image_tag "svg/illustrations/non-standard-hero-shape.svg", class: "js-svg-injector", data: {
img_paths: '[
{"targetId": "#SVGNonStandardHeroShapeImg1", "newPath": "<%= image_path(\'cover-photo.jpg\') %>"},
{"targetId": "#SVGNonStandardHeroShapeImg2", "newPath": "<%= image_path(\'cover-photo.jpg\') %>"}
]',
parent: "#SVGNonStandardHeroShape" } %>
这两个调用有问题
<%= image_path(\'cover-photo.jpg\') %>
错误是:
syntax error, unexpected tIDENTIFIER, expecting '}'
syntax error, unexpected ']', expecting ')'