jbuilder
https://github.com/rails/jbuilder
Ruby
Jbuilder: generate JSON objects with a Builder-style DSL
JbuilderTemplate#cache!
Caches the json constructed within the block passed. Has the same signature as the `cache` helper
method in `ActionView::Helpers::CacheHelper` and so can be used in the same way.
Example:
json.cache! ['v1', @person], expires_in: 10.minutes do
json.extract! @person, :name, :age
endEdit
git clone [email protected]:rails/jbuilder.git
cd jbuilder
open lib/jbuilder/jbuilder_template.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-JbuilderTemplate-cache--for-pr
# Commit to gitgit add lib/jbuilder/jbuilder_template.rbgit commit -m "better docs for JbuilderTemplate#cache!"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-JbuilderTemplate-cache--for-pr
hub pull-request
# Celebrate!