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.
423 424 425 426 427 428 |
# File 'lib/blueprinter/base.rb', line 423 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 |