summaryrefslogtreecommitdiff
path: root/app/controllers/content_controller.rb
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-03-02 20:29:25 +0100
committerhukl <contact@smyck.org>2009-03-03 19:47:18 +0100
commit82f16e71d49350c1ad4aa48773db5d0f45a55c6c (patch)
tree72a341b68e2b1f35772e11add0bef7208e9b90b6 /app/controllers/content_controller.rb
parentc9183349c2fbacf24fca5cd7767190d069ce8873 (diff)
introducing page templates - need to add edit capabilities
renamed the custom template folder forgot one fix for the new custom template path page templates refined renamed page attribute template to template_name as i suspected it to be a reserved word. it still didn't work until i discovered that simon defined the accessible attributes! That costed me 40 minutes of lifetime. But he apologized ;) tests for public and custom page templates
Diffstat (limited to 'app/controllers/content_controller.rb')
-rw-r--r--app/controllers/content_controller.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb
index 0fa9832..706cfcd 100644
--- a/app/controllers/content_controller.rb
+++ b/app/controllers/content_controller.rb
@@ -10,8 +10,14 @@ class ContentController < ApplicationController
10 10
11 @page = Node.find_page(path) 11 @page = Node.find_page(path)
12 12
13 # Replace with real 404 13 if @page
14 unless @page 14 template = @page.valid_template
15
16 render(
17 :file => template,
18 :layout => true
19 )
20 else
15 render( 21 render(
16 :file => File.join(RAILS_ROOT, 'public', '404.html'), 22 :file => File.join(RAILS_ROOT, 'public', '404.html'),
17 :status => 404 23 :status => 404