2010-05-16 12:01:38 -07:00
|
|
|
class SwfAssetsController < ApplicationController
|
|
|
|
def index
|
2010-05-20 16:56:08 -07:00
|
|
|
if params[:item_id]
|
|
|
|
@swf_assets = Item.find(params[:item_id]).swf_assets.for_json.all
|
|
|
|
elsif params[:pet_type_id]
|
2010-05-20 18:16:35 -07:00
|
|
|
@swf_assets = PetType.find(params[:pet_type_id]).pet_states.first.swf_assets.for_json.all
|
2010-05-20 16:56:08 -07:00
|
|
|
end
|
|
|
|
render :json => @swf_assets
|
2010-05-16 12:01:38 -07:00
|
|
|
end
|
|
|
|
end
|