GithubHelp home page GithubHelp logo

ruby-ejs's People

Contributors

byroot avatar pixeltrix avatar sstephenson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ruby-ejs's Issues

Serving .ejs files from rails?

I feel like an idiot for not being able to figure this out, but here goes.

In rails, my assets/javascripts/foo.jst.ejs file is served up as localhost:3000/assets/foo and assets/foo.js, but localhost:3000/assets/foo.ejs gives a routing error. I have some framework code that insists on calling it with the .ejs extension.

I think this should be an simple config somewhere in the asset pipeline, but I can't find it. I realize it is more of and rails question, but perhaps somebody here recognizes this?

jquery/rails/railtie.rb:9:in `block in <class:Railtie>': undefined method `join' for nil:NilClass

Hello, unfortunately I catch the error with Rails 4.1 and els 1.1.1 while blotting my application:
(ejs 1.0.0 works fine)

/Users/alex/.rvm/gems/ruby-2.1.1/gems/jquery-rails-2.1.4/lib/jquery/rails/railtie.rb:9:in `block in <class:Railtie>': undefined method `join' for nil:NilClass (NoMethodError)
    from /Users/alex/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0.rc2/lib/active_support/lazy_load_hooks.rb:36:in `call'
    from /Users/alex/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0.rc2/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
    from /Users/alex/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0.rc2/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
    from /Users/alex/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0.rc2/lib/active_support/lazy_load_hooks.rb:44:in `each'
    from /Users/alex/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0.rc2/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
    from /Users/alex/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0.rc2/lib/rails/application.rb:121:in `initialize'
    from /Users/alex/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0.rc2/lib/rails/railtie.rb:171:in `new'
    from /Users/alex/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0.rc2/lib/rails/railtie.rb:171:in `instance'
    from /Users/alex/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0.rc2/lib/rails/application.rb:90:in `inherited'

Problem with conditional JS inside <%- %>

I have a problem when I try to use something like
<%- null_var || "some string" %>

in my .jst.ejs template, it evaluate as "null" || "some string" which always return "null" string

So it's work If I do <%- (null_var || "some string) %> or <%- "%s", null || "some string" %> it should be bug

Pleas fix this for clean code, Thanks :)

Partial Support?

Is there any way to get partials working?

I just tried to do it with <%= this.partial('some_partial'); %> but it doesn't work. I looked it up in the source and think it's not implemented yet, is it?

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

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.

EJS Javacript file

I think it would be nice if the EJS Javascript file would be added to this gem, so that people don't have to download it and place in the lib or vendor folder.

ReferenceError when variable does not exist

Hello, Stephenson

I'm getting the following exception when I try to compile a template function without any variables.

Uncaught ReferenceError: id is not defined

Suppose I have the following template:

<span data-id="<%= id %>"><%= content %></span>

And I run this with the function:

JST["template"]()

It won't work.

Using Rails 3.1.1 with Asset Pipeline.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.