summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/content_controller.rb7
-rw-r--r--app/models/node.rb3
-rw-r--r--app/views/layouts/application.html.erb0
3 files changed, 10 insertions, 0 deletions
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 @@
1class ContentController < ApplicationController 1class ContentController < ApplicationController
2
2 def render_page 3 def render_page
4 path = params[:page_path].join('/')
5
6 @node = Node.find_by_unique_name(path)
7
8 # Replace with real 404
9 render :status => 404 unless @node
3 end 10 end
4 11
5end 12end
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 @@
1class Node < ActiveRecord::Base
2 acts_as_nested_set
3end
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/app/views/layouts/application.html.erb