Files
danbooru/app/controllers/artist_commentary_versions_controller.rb
evazion 2564e885c8 controllers: refactor only param includes.
Add extra includes needed by the `only` param inside `respond_with`.
2020-02-15 06:17:22 -06:00

18 lines
604 B
Ruby

class ArtistCommentaryVersionsController < ApplicationController
respond_to :html, :xml, :json
def index
@commentary_versions = ArtistCommentaryVersion.paginated_search(params)
@commentary_versions = @commentary_versions.includes(:updater, post: :uploader) if request.format.html?
respond_with(@commentary_versions)
end
def show
@commentary_version = ArtistCommentaryVersion.find(params[:id])
respond_with(@commentary_version) do |format|
format.html { redirect_to artist_commentary_versions_path(search: { post_id: @commentary_version.post_id }) }
end
end
end