Files
danbooru/app/controllers/sources_controller.rb
evazion a7dc05ce63 Enable frozen string literals.
Make all string literals immutable by default.
2021-12-14 21:33:27 -06:00

15 lines
375 B
Ruby

# frozen_string_literal: true
class SourcesController < ApplicationController
respond_to :js, :json, :xml
def show
@source = Sources::Strategies.find(params[:url], params[:ref])
respond_with(@source.to_h) do |format|
format.xml { render xml: @source.to_h.to_xml(root: "source") }
format.json { render json: @source.to_h.to_json }
end
end
end