2024-01-24 06:53:37 -08:00
|
|
|
class AltStylesController < ApplicationController
|
|
|
|
def index
|
|
|
|
@alt_styles = AltStyle.includes(:species, :color, :swf_assets).
|
2024-01-28 07:30:06 -08:00
|
|
|
order(:species_id, :color_id)
|
|
|
|
|
|
|
|
if params[:species_id]
|
|
|
|
@species = Species.find(params[:species_id])
|
|
|
|
@alt_styles = @alt_styles.merge(@species.alt_styles)
|
|
|
|
end
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html { render }
|
2024-01-29 03:20:48 -08:00
|
|
|
format.json {
|
2024-01-30 07:01:03 -08:00
|
|
|
render json: @alt_styles.includes(swf_assets: [:zone]).as_json(
|
2024-01-31 03:02:19 -08:00
|
|
|
include: {
|
|
|
|
swf_assets: {
|
|
|
|
include: [:zone],
|
|
|
|
methods: [:html5_image_url, :html5_svg_url],
|
|
|
|
}
|
|
|
|
},
|
2024-01-30 05:54:20 -08:00
|
|
|
methods: [:series_name, :adjective_name, :thumbnail_url],
|
2024-01-29 03:20:48 -08:00
|
|
|
)
|
|
|
|
}
|
2024-01-28 07:30:06 -08:00
|
|
|
end
|
2024-01-24 06:53:37 -08:00
|
|
|
end
|
|
|
|
end
|