summaryrefslogtreecommitdiff
path: root/app/controllers/nodes_controller.rb
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-02-22 12:52:58 +0100
committerhukl <contact@smyck.org>2009-02-22 12:52:58 +0100
commitc39eb1e9839664deb68b50b2a9db16770d42852c (patch)
treee1c6b0ceb1309074e6018ac1a61adb218552154b /app/controllers/nodes_controller.rb
parente0d5557a9e7f88050da2ccb42e02397952cded0d (diff)
another round of view updates
Diffstat (limited to 'app/controllers/nodes_controller.rb')
-rw-r--r--app/controllers/nodes_controller.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb
index baf023f..829e26f 100644
--- a/app/controllers/nodes_controller.rb
+++ b/app/controllers/nodes_controller.rb
@@ -3,7 +3,6 @@ class NodesController < ApplicationController
3 layout 'admin' 3 layout 'admin'
4 before_filter :login_required 4 before_filter :login_required
5 before_filter :find_node, :only => [ 5 before_filter :find_node, :only => [
6 :create,
7 :show, 6 :show,
8 :edit, 7 :edit,
9 :update, 8 :update,
@@ -21,15 +20,18 @@ class NodesController < ApplicationController
21 end 20 end
22 21
23 def new 22 def new
24 @node = Node.new 23 @node = Node.new params[:node]
25 end 24 end
26 25
27 def create 26 def create
28 tmp_node = Node.new( params[:node] ) 27 parent = Node.find_by_unique_name(params[:parent_unique_name])
28 parent ||= Node.root
29 29
30 if request.post? and tmp_node.save 30 @node = Node.new( params[:node] )
31 tmp_node.move_to_child_of @node 31
32 redirect_to(tmp_node) 32 if request.post? and @node.save
33 @node.move_to_child_of parent
34 redirect_to(@node)
33 else 35 else
34 render :action => :new 36 render :action => :new
35 end 37 end