Appdoc
Appdoc allows you to easily add documentation to your web app.
Installation
Appdoc has been tested through Rails 3.0.10.
Add the following to your Gemfile
gem "appdoc"
From the command line
> bundle install
After you install Appdoc, you will need to run the generator:
> rails generate appdoc > rake db:migrate
Customize 'config/initializers/appdoc_config.rb' to suit your needs:
Appdoc.config do |config| config.delimiter = " " #changing this line may affect the functionality of this gem. config.autocompleteValues = ["dashboard", "users"] config.minSearchLength = 2 config.placeholder = "Start typing for suggested tags" end
For authentication, Appdoc supports both devise and cancan.
Appdoc uses declarative_autorization for role based permissions. Though not required, this is recomended if you want to prevent certain users from creating, editing, and destroying documents.
You are now good to go!
Usage
To find all the documents related to a certain page, try the following
Document.tagged_with(controller.controller_name)
You can use this to show all the documents tagged with the current page. For example, if you have a 'Product' model, you can add the tag 'products' to the faq page you want displayed on Products#index.
For more examples on how to use tags, see acts-as-taggable-on.
Customization
Appdoc uses Kaminari for pagination. To customize the pagination themes, see github.com/amatsuda/kaminari/blob/master/README.rdoc under “Customizing the pagination helper”.
Appdoc also supports will_paginate.