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.
- Host: GitHub
- URL: https://github.com/amiel/weld-rails
- Owner: amiel
- Created: 2011-09-15T06:55:45.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-09-15T07:05:14.000Z (almost 15 years ago)
- Last Synced: 2024-10-03T12:33:06.290Z (over 1 year ago)
- Language: Ruby
- Size: 97.7 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
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
-
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:
-
John Doe
Gardener
-
James Smith
Landscaper