Improving all forms
This commit is contained in:
parent
6f7c9774c7
commit
43df35213e
16 changed files with 268 additions and 267 deletions
|
@ -1,5 +1,6 @@
|
|||
class XrdController < ApplicationController
|
||||
before_action :set_default_format
|
||||
before_action :set_default_format_json, only: :webfinger
|
||||
before_action :set_default_format_xml, only: :host_meta
|
||||
|
||||
def host_meta
|
||||
@webfinger_template = "#{webfinger_url}?resource={uri}"
|
||||
|
@ -24,7 +25,11 @@ class XrdController < ApplicationController
|
|||
|
||||
private
|
||||
|
||||
def set_default_format
|
||||
def set_default_format_xml
|
||||
request.format = 'xml' if request.headers["HTTP_ACCEPT"].nil? && params[:format].nil?
|
||||
end
|
||||
|
||||
def set_default_format_json
|
||||
request.format = 'json' if request.headers["HTTP_ACCEPT"].nil? && params[:format].nil?
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue