So it looks like rails is interpreting the ejs
file as ruby and chokes when it hits the javascript syntax. Here's 2 suggestions:
Use the ruby-ejs gem to render the partial to a text string using javsccript.
EJS.evaluate("Hello <%= name %>", :name => "world")
# => "Hello world"
You would just need to load the file in to pass its contents to
evaluate
without trying to parse it first.File.open("app/views/controller_name/_my_awesome_template.html.ejs").read
You could rewrite the
ejs
partial in ruby unless you're using it elsewhere in a javascript context.