0.06
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Jbuilder support for Tilt
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

< 3, >= 1.3.0
 Project Readme

tilt-jbuilder

Adds support for rendering Jbuilder templates using Tilt.

Gem Version Build Status Dependency Status Coverage Status Code Climate

Installation

Add this line to your application's Gemfile:

gem 'tilt-jbuilder'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tilt-jbuilder

Usage

require 'tilt/jbuilder.rb'

template = Tilt::JbuilderTemplate.new("templates/awesomeness.json.jbuilder")
template.render

# With locals
template = Tilt::JbuilderTemplate.new { "json.author name" }
template.render(nil, :name => 'Anthony')

# With scope
template = Tilt::JbuilderTemplate.new { "json.author @name" }
scope = Object.new
scope.instance_variable_set :@name, 'Anthony'
template.render(scope)

# Block style
template = Tilt::JbuilderTemplate.new do |t|
  lambda { |json| json.author 'Anthony'; json.target! }
end
template.render

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Credits

Sticksnleaves

tilt-jbuilder is maintained and funded by Sticksnleaves

Thanks to all of our contributors