Module: Apress::Documentation::DocumentsHelper

Defined in:
app/helpers/apress/documentation/documents_helper.rb

Instance Method Summary collapse

Instance Method Details

#document_url_with_swagger(document) ⇒ Object



4
5
6
7
8
9
10
11
# File 'app/helpers/apress/documentation/documents_helper.rb', line 4

def document_url_with_swagger(document)
  if document.is_a?(Apress::Documentation::Storage::SwaggerDocument)
    js_path = "#!/#{document.tag}/#{document.operation_id}"
    documentation_url(path: document.document.slug.to_s) + js_path
  else
    documentation_url(path: document.slug.to_s)
  end
end