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 }
|
|
|
|
format.json { render json: @alt_styles }
|
|
|
|
end
|
2024-01-24 06:53:37 -08:00
|
|
|
end
|
|
|
|
end
|