Tickets

#18 (Open) [PATCH] Fix where @page is not defined (where there are no page)

last changed by Chris Anderton

On a new installation with no pages then the home page bunks out because @page is nil.

I can see three approaches to fixing this:

1. Modify the controller (app/controllers/home_controller.rb) 2. Modify the view (app/views/home/index.rhtml) 3. Modify the model (app/models/page.rb)

I took the second approach and checked whether @page existed in the view – if not it displays ‘No Pages Defined’.

Health warning is that the check should probably be done elsewhere – i just wanted a fix to get it working so i could play with devil.

http://pastie.caboo.se/122385