Skip to content


Browse files Browse the repository at this point in the history
Add basic usage to readme
  • Loading branch information
adambeynon committed Dec 4, 2013
1 parent 4d1296f commit c52b37e
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions
Expand Up @@ -2,6 +2,44 @@

Haml templates for opal

## Usage

Add opal-haml to your `Gemfile`:

gem 'opal-haml', :github => 'opal/opal-haml'

Create a haml file in the opal load path (e.g. `app/user_template.haml`):

= self.age

Render the haml template:

# app/application.rb
require 'user_template'

class User
attr_accessor :name, :age

def initialize(name, age)
@name, @age = name age

user ='Ford Perfect', 42)
html = Template['user_template'].render(user)
puts html
# => <div class="row">...</div>

## Running tests

Get dependencies:
Expand Down

0 comments on commit c52b37e

Please sign in to comment.