/sources: add /sources.xml endpoint.

This commit is contained in:
evazion
2017-03-16 17:30:39 -05:00
parent d9a26975ba
commit 28bdfce9f6
2 changed files with 5 additions and 8 deletions

View File

@@ -1,15 +1,12 @@
class SourcesController < ApplicationController
# before_filter :member_only
respond_to :json
respond_to :json, :xml
def show
@source = Sources::Site.new(params[:url], :referer_url => params[:ref])
@source.get
respond_with(@source) do |format|
format.json do
render :json => @source.to_json
end
respond_with(@source.to_h) do |format|
format.xml { render xml: @source.to_h.to_xml(root: "source") }
end
end