Method: Blueprinter::Base.view
- Defined in:
- lib/blueprinter/base.rb
.view(view_name) ⇒ View
Specify a view and the fields it should have. It accepts a view name and a block. The block should specify the fields.
428 429 430 431 432 433 |
# File 'lib/blueprinter/base.rb', line 428 def self.view(view_name) @current_view = view_collection[view_name] view_collection[:default].track_definition_order(view_name) yield @current_view = view_collection[:default] end |