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



4
5
6
7
# File 'app/controllers/hangar/resources_controller.rb', line 4

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

#newObject



9
10
11
12
# File 'app/controllers/hangar/resources_controller.rb', line 9

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