Files
danbooru/app/controllers/note_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
496 B
Ruby

class NoteVersionsController < ApplicationController
respond_to :html, :xml, :json
def index
@note_versions = NoteVersion.paginated_search(params)
@note_versions = @note_versions.includes(:updater) if request.format.html?
respond_with(@note_versions)
end
def show
@note_version = NoteVersion.find(params[:id])
respond_with(@note_version) do |format|
format.html { redirect_to note_versions_path(search: { note_id: @note_version.note_id }) }
end
end
end