summaryrefslogtreecommitdiff
path: root/app/controllers/nodes_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/nodes_controller.rb')
-rw-r--r--app/controllers/nodes_controller.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb
index 81ead62..0c961b7 100644
--- a/app/controllers/nodes_controller.rb
+++ b/app/controllers/nodes_controller.rb
@@ -32,7 +32,7 @@ class NodesController < ApplicationController
32 32
33 if parent and @node.save 33 if parent and @node.save
34 @node.move_to_child_of parent 34 @node.move_to_child_of parent
35 redirect_to(@node) 35 redirect_to(edit_node_path(@node))
36 else 36 else
37 @node.errors.add("Parent node") 37 @node.errors.add("Parent node")
38 render :action => :new 38 render :action => :new
@@ -40,7 +40,15 @@ class NodesController < ApplicationController
40 end 40 end
41 41
42 def show 42 def show
43 @nodes = Node.find(params[:id]).children 43 @page = Node.find(params[:id]).draft
44
45 if @page
46 template = @page.valid_template
47 render(
48 :file => template,
49 :layout => "application"
50 )
51 end
44 end 52 end
45 53
46 def edit 54 def edit