Class: Hangar::ResourcesController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/hangar/resources_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


6
7
8
9
# File 'app/controllers/hangar/resources_controller.rb', line 6

def create
  created = FactoryBot.create resource, *traits, resource_attributes
  render json: created.as_json(include: includes)
end

#newObject


11
12
13
14
# File 'app/controllers/hangar/resources_controller.rb', line 11

def new
  attributes = FactoryBot.attributes_for resource, *traits, resource_attributes
  render json: attributes
end