Files
danbooru/app/controllers/sources_controller.rb
evazion 056fe365f2 Render "Fetch source data" box html server-side.
Instead of calling /sources.json and rendering the "Fetch source data"
box client-side in Javascript, call /sources.js so we can render the
html server-side.
2018-09-08 15:42:16 -05:00

13 lines
344 B
Ruby

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