You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of the time, you'll use bldr in a sinatra endpoint by using the bldr helper method. However, there are some cases where you need to generate json outside of the request / response cycle, and it's often useful to be able to use bldr in those situations. Here's how it's done.
The first line initializes a Bldr::Template object, which is a subclass of Tilt::Template. We then call the render method, passing in the scope in which the template is to be eval-ed by tilt, and an optional hash of local variables. The signature here is relatively simple, you just need to know how to use it.