Sha256: e6b0cbb3affec3ecb1124811f50c731153e626e14f49bdcaa7867639bae8adb4
Contents?: true
Size: 540 Bytes
Versions: 3
Compression:
Stored size: 540 Bytes
Contents
module FactoryGirl module RemoteApi class FactoriesController < FactoryGirl::RemoteApi::ApplicationController respond_to :json def create @model = FactoryGirl.create(params[:factory], factory_attributes) respond_with @model end def show @model = FactoryGirl.attributes_for(params[:factory], factory_attributes) respond_with @model end private def factory_attributes params[params[:factory]].try(:except, :parent_factory) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems