Class: RemoteFactoryGirlHomeRails::HomeController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- RemoteFactoryGirlHomeRails::HomeController
- Defined in:
- app/controllers/remote_factory_girl_home_rails/home_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/remote_factory_girl_home_rails/home_controller.rb', line 8 def create if RemoteFactoryGirlHomeRails.enabled? resource = FactoryGirl.create(factory(params), attributes(params)) render json: Serializer.serialize(resource) else forbidden = 403 render json: { status: forbidden }, status: forbidden end end |
#index ⇒ Object
18 19 20 21 |
# File 'app/controllers/remote_factory_girl_home_rails/home_controller.rb', line 18 def index factories = FactoryGirl.factories.map(&:name) render json: { factories: factories } end |