Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Fails when used with Rails and given an ActiveSupport::SafeBuffer #10

Open
moll opened this issue Sep 22, 2012 · 0 comments
Open

Fails when used with Rails and given an ActiveSupport::SafeBuffer #10

moll opened this issue Sep 22, 2012 · 0 comments

Comments

@moll
Copy link

moll commented Sep 22, 2012

This is a mirror of a bug on Sprockets as it affects either.

The problem is this: EjsTemplate passes data to EJS.compile which uses gsub! in its implementation. When used with Rails, data is an ActiveSupport::SafeBuffer whose gsub! is messed up at the moment and breaks $1, so the EJS compiling fails.

Should EjsTemplate force data to be a regular string with to_str or should that be EJS's job to make sure the input is a regular string?

I've made a committed fix on ruby-ejs' end for now quick use. If that's the best place to convert SafeBuffers to strings, I can just make a pull request or you can pick a cherry.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant