3

I am using 'eco' gem with my Rails application to load Eco templates. The templates are really handy and automatically loaded by Rails 3.1 asset pipeline. The only problem is that each .js file generated by eco includes the same javascript code that mainly deals with html escaping. The code is about 1.5K in non-minified form. It may become significant overhead if application uses a lot of templates (like a hundred of them). Is there a way to take this code out of the js files and include only once?

1 Answer 1

1

See gist https://gist.github.com/2043682 , I have extracted out the common part.

Sign up to request clarification or add additional context in comments.

1 Comment

The capture feature requires closure, otherwise it can be much simpler.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.