Hobo Cookbook

View Source

Question: How can you generate an empty page?

Asks tonlap
We created a calender with a rails plugin and it worked. Now we have the calender-page and we try to implemt it inside a ne page. But how do you create one?
When you generate a new page without any database customizations there is an error.
We can create the menu entry but can't create the rest like there is at Home.

rgds tonlap

I like the approach of Hobo but it's not so easy to get started with.

Discussion

  • Easiest approach is to add it to the front controller. Add a new method named how you would like the route to be shown. Put your page under app/views/front/ and it should show up (may need mongrel/thin/etc restart).

    $ cat app/controllers/front_controller.rb
    ...
      def about
        response.headers['Cache-Control'] = 'public, max-age=300'
      end
    ...
    
    $ cat app/views/front/about.dryml 
    <page>
      <side-nav:>
      ....
  • Oh, you don't need that line in the controller method but if it's a static or near static page will save some processor cycles.