Provides an area to store your static pages that still need to be rendered with the application layout. You also get short routes to any template placed in the directory.
Ideal for pages like:
-
Homepage
-
Contact Us
-
Privacy Policy
-
Terms of Service
-
Error pages
Error pages will automatically be sought out in the static_pages directory with a fallback to the standard Rails behavior.
script/plugin install git://github.com/jqr/static_pages.git
Once installed the plugin will create a folder app/views/static_pages/ for keeping of your static pages. Requests that aren’t handled by your other routes will fall back to looking for a template in static_pages.
home.html.erb # site.com/home contact_us.html.erb # site.com/contact_us 500.html.erb # site.com/500 and when your app gives a 500 error
You can easily test the error pages in development mode by adding this method to your ApplicationController.
def rescue_action(exception) rescue_action_in_public(exception) end
rdoc.info/projects/jqr/static_pages
- Homepage
- License
-
Copyright © 2008 Elijah Miller <elijah.miller@gmail.com>, released under the MIT license