An open API service indexing awesome lists of open source software.

https://github.com/amiel/weld-rails

Weld-rails allows rails to use weld as a template handler.
https://github.com/amiel/weld-rails

Last synced: about 1 year ago
JSON representation

Weld-rails allows rails to use weld as a template handler.

Awesome Lists containing this project

README

          

Weld-Rails
==========

Weld-rails allows rails to use weld as a template handler.

Weld-rails is currently alpha and should not be used in production.

DESCRIPTION
===========

Currently, it can successfully compile a simple weld template using weld.js, jsdom (and it's dependencies), and Node (through ExecJS).

USAGE
=====

app/views/test/index.html.weld



  1. John Doe
    Groundskeeper

app/views/test/index.rb

class Views::Test < Weld::View
def index
{
person: @people.collect { |person|
{ name: person.name, title: person.title }
}
}
end
end

app/controllers/test_controller.rb
class TestController < ApplicationController
def index
@people = Person.all
end
end

Will render something like:



  1. John Doe
    Gardener


  2. James Smith
    Landscaper