Class: Hangar::ResourcesController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Hangar::ResourcesController
- Defined in:
- app/controllers/hangar/resources_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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 |
#new ⇒ Object
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 |