Let's make static pages have some live.
This gem provides a simple and clean way to add static pages to your application.
The content of the static pages is stored in a google doc document that wax_museum scraps and put inside your layout. So the content can be updated without the need of database models or admin areas.
Currently the gem only can be fetched from github. Add to Gemfile:
gem 'wax_museum', git: 'git://github.com/recortable/wax_museum.git'
Write the content of each static page in a google docs document. You have to publish the document to retrieve the document id.
There are several ways to configure wax museum:
Write an initializer:
WaxMuseum.config do
publish 'about', '1spk6wI4eD5WxvHgmUVaVcQLiReDo9pjPqPMUHN5Z3TI'
end
Not ready yet.
## Generate routes
In your routes.rb
file add the following line:
WaxMuseum::Routes.draw
Remember the routes are order dependant, so where you put this line is important.
With the above configuration, you will get a '/about' path that points to the contents of the google document.
You can pass options to the Routes.write method:
WaxMuseum::Routes.draw(prefix: 'info')
The options are:
- prefix: Add a path prefix to the route ('/info/about' instead of '/about'). Defaults to ''
- cache: Perform fragment caching in the views. Defaults to true
This is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.