From be47a4bbeac59d85af16b5e83e10ff242628519d Mon Sep 17 00:00:00 2001 From: hukl Date: Thu, 29 Jan 2009 22:12:11 +0100 Subject: added node model to make basic functional tests pass. added awesome_nested_set plugin --- app/controllers/content_controller.rb | 7 +++++++ app/models/node.rb | 3 +++ app/views/layouts/application.html.erb | 0 3 files changed, 10 insertions(+) create mode 100644 app/models/node.rb create mode 100644 app/views/layouts/application.html.erb (limited to 'app') diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index afa093c..8059fab 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb @@ -1,5 +1,12 @@ class ContentController < ApplicationController + def render_page + path = params[:page_path].join('/') + + @node = Node.find_by_unique_name(path) + + # Replace with real 404 + render :status => 404 unless @node end end diff --git a/app/models/node.rb b/app/models/node.rb new file mode 100644 index 0000000..82183c9 --- /dev/null +++ b/app/models/node.rb @@ -0,0 +1,3 @@ +class Node < ActiveRecord::Base + acts_as_nested_set +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000..e69de29 -- cgit v1.3