1
0
Fork 0
forked from OpenNeo/impress

load happy pets for item db previews

This commit is contained in:
Emi Matchu 2011-02-22 18:11:12 -05:00
parent 8ff6c5ad9c
commit 492841d9bc

View file

@ -20,7 +20,7 @@ class SwfAssetsController < ApplicationController
pet_state_id = params[:pet_state_id].to_i pet_state_id = params[:pet_state_id].to_i
json = @swf_assets.map { |a| a.as_json(:parent_id => pet_state_id, :for => 'wardrobe') } json = @swf_assets.map { |a| a.as_json(:parent_id => pet_state_id, :for => 'wardrobe') }
elsif params[:pet_type_id] elsif params[:pet_type_id]
@swf_assets = PetType.find(params[:pet_type_id]).pet_states.first.swf_assets @swf_assets = PetType.find(params[:pet_type_id]).pet_states.emotion_order.first.swf_assets
end end
json ||= @swf_assets ? @swf_assets.all : nil json ||= @swf_assets ? @swf_assets.all : nil
render :json => json render :json => json