Created
November 20, 2014 20:30
-
-
Save strukturedkaos/fe01bd38a9880498180e to your computer and use it in GitHub Desktop.
Serving Yard Documentation with Rails and HighVoltage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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