In Gemfile =>
Then run (via cmd) =>
sdoc -o doc/rails_app
Just that is fine, and you can check your generated documentation file at /doc/rails_app/index.html, but we want our documentation to look a bit organized (and without the test folder).
Use the task generator to create a new namespace:
rails g task rdoc
Open /lib/tasks/rdoc.rake. In there, you'll find =>
namespace :rdoc do
Replace that with the code below:
RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = 'doc/rdoc'
rdoc.generator = 'sdoc'
rdoc.template = 'rails'
rdoc.rdoc_files.include('Gemfile', 'README.md', 'app/', 'db/', 'lib/')
You can run (in cmd)
rails rdoc, and open doc/rdoc/index.html in your browser . . . to update the documentation, run
Image by =>
Ruby on Rails developer, AWS Engineer, anything fun, music, a little bit of mobile game. . .