【发布时间】:2020-01-03 23:15:44
【问题描述】:
我在让这个嵌入式 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 ')'
【问题讨论】:
标签: ruby embedded-ruby