Skip to content

Any plans for a ruby gem that can be used with Rails asset pipeline #14

Open

Description

@tusharr

First of all, great job on this templating engine. Really easy to use & understand syntax.

Are there any plans for a ruby gem anytime soon that be used with Rails asset pipeline?
Thanks

Activity

  1. malgorithms commented on Feb 7, 2013

    @malgorithms
    Owner

    This is very interesting to me. Although: I have never used ruby before, other than just poking around back when RoR first started getting popular.

    So I don't know what this would require. When you refer to the asset pipeline, are you talking about server-side rendering of templates, or just getting toffee templates onto the browser (for rendering client side) in a Rails project?

    Toffee relies on CoffeeScript itself for evaluation the #{} regions and of course anything inside of coffeescript region: {# #}. So getting this working server-side in rails requires running JavaScript. Is there a way to execute JavaScript in ruby?

    Btw, an alternative is a new templating language just like Toffee, except Ruby instead of CoffeeScript inside the appropriate regions. People might like that, too.

  2. tusharr commented on Feb 7, 2013

    @tusharr
    Author

    Apart from the JS templating, eco implements this for the server side as well. So, in development, I write eco templates show.jst.eco and save. When I refresh the page, the browser makes a call to the server, which ends up compiling the eco template to JS using coffescript and the eco preprocessor.

    Its similar to how the coffeescript & sass files are preprocessed in the Rails asset pipeline.

    I do not have the time right now to develop this, but their are quite a few examples of Rails asset-pipeline preprocessors out there.

  3. malgorithms commented on Feb 7, 2013

    @malgorithms
    Owner

    I just took a look at eco's ruby implemention: https://github.com/sstephenson/ruby-eco ... it appears he uses a library called ExecJS to let a ruby user compile the templates via the shell and then eval them. This kind of thing should be doable with Toffee (since it also can compile templates to JS at the command line into a single package), although I prob won't get a chance to mess with this in the next couple weeks. I suspect it's easy for someone who knows what they're doing in ruby, if there are any volunteers...

    -cc

  4. gbouthenot commented on Mar 25, 2013

    @gbouthenot

    +1 for Ruby on rails integration into asset pipeline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions