impress/app/controllers/alt_styles_controller.rb
Emi Matchu 514c99fb42 Add WIP styles tab to the pose picker
It shows the styles! You can select between them, but it currently does
nothing, womp womp!
2024-01-29 04:26:40 -08:00

20 lines
478 B
Ruby

class AltStylesController < ApplicationController
def index
@alt_styles = AltStyle.includes(:species, :color, :swf_assets).
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.as_json(
methods: [:adjective_name, :thumbnail_url],
)
}
end
end
end