- if @document.tags('deprecated').size > 0
p.deprecated DEPRECATED: #{@document.tags('deprecated').first.text}
h1
= @controller_name.gsub('::', '/').camelize + '#' +@action_name
- if @document.tags('version').size > 0
| (v#{@document.tags('version').first.text})
ul.urls
- for route in routes_for(@controller_name.gsub('::', '/'), @action_name)
li
span.method= route[:method]
= route[:path]
== markup @document.docstring.to_s
- if @document.tags('param').size > 0
h2 Params
ul.params
- for param in @document.tags('param')
li
| ( #{param.types.map(&:downcase).join(', ')} ) #{param.name}
— #{param.text}
- if (options = @document.tags('option').select{|opt| opt.name == param.name }).size > 0
ul
- for option in options
li ( #{option.pair.types.map(&:downcase).join(', ')} ) #{option.pair.name}
— #{option.pair.text}
- if @document.tags('example').size > 0
h2 Example
- for example in @document.tags('example')
h3= example.name
pre
code= example.text
- if @document.tags('response').size > 0
h2 Response
- for response in @document.tags('response')
pre
span.type= response.name.to_s.upcase
code== syntaxhighlight response.name, response.text
- if @document.tags('todo').size > 0
h2 ToDo
- for todo in @document.tags('todo')
== markup todo.text
h2 Code
p
code= @document.file.sub(Rails.root.to_s, '')
pre
code== syntaxhighlight :ruby, @document.source