Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rendering

You can read the full rendering documentation here. This page highlights the main differences between V1 and V2.

Rendering to JSON

If you’re using Rails’s render json:, V2 blueprints should continue to work like Legacy/V1:

render json: WidgetBlueprint.render(widget)

Otherwise, it now looks like this:

WidgetBlueprint.render(widget).to_json

Rendering to Hash

WidgetBlueprint.render(widget).to_hash

Views

V2’s preferred method of rendering views is:

WidgetBlueprint[:extended].render(widget).to_json

However, the ViewOption extension can be enabled to allow V1-style view rendering:

WidgetBlueprint.render(widget, view: :extended).to_json