Skip to content

Instantly share code, notes, and snippets.

@strukturedkaos
Created November 20, 2014 20:30
Show Gist options
  • Save strukturedkaos/fe01bd38a9880498180e to your computer and use it in GitHub Desktop.
Save strukturedkaos/fe01bd38a9880498180e to your computer and use it in GitHub Desktop.
Serving Yard Documentation with Rails and HighVoltage
# config/routes.rb
get "/doc" => "docs#show", id: "index"
get '/doc/*id' => 'docs#show'
# app/controllers/docs_controller.rb
class DocsController < HighVoltage::PagesController
respond_to :html
layout false
def show
render file: current_page
end
end
# config/initializers/high_voltage.rb
HighVoltage.routes = false
HighVoltage.layout = false
HighVoltage.content_path = Rails.root.join 'doc/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment