/sources: add /sources.xml endpoint.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ module Sources
|
||||
WikiPage.other_names_match(untranslated_tags).map{|wiki_page| [wiki_page.title, wiki_page.category_name]}
|
||||
end
|
||||
|
||||
def to_json
|
||||
def to_h
|
||||
return {
|
||||
:artist_name => artist_name,
|
||||
:profile_url => profile_url,
|
||||
@@ -71,7 +71,7 @@ module Sources
|
||||
:title => artist_commentary_title,
|
||||
:description => artist_commentary_desc,
|
||||
}
|
||||
}.to_json
|
||||
}
|
||||
end
|
||||
|
||||
def available?
|
||||
|
||||
Reference in New Issue
Block a user