diff options
Diffstat (limited to 'app/controllers/nodes_controller.rb')
| -rw-r--r-- | app/controllers/nodes_controller.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index b66ea49..9834a17 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb | |||
| @@ -27,12 +27,7 @@ class NodesController < ApplicationController | |||
| 27 | def new | 27 | def new |
| 28 | @node = Node.new node_params | 28 | @node = Node.new node_params |
| 29 | @selected_kind = CccConventions::NODE_KINDS.key?(params[:kind]) ? params[:kind] : "generic" | 29 | @selected_kind = CccConventions::NODE_KINDS.key?(params[:kind]) ? params[:kind] : "generic" |
| 30 | if params.has_key?(:parent_id) | 30 | @parent = Node.find(params[:parent_id]) if params.has_key?(:parent_id) |
| 31 | @parent_id = params[:parent_id] | ||
| 32 | parent = Node.find(@parent_id) | ||
| 33 | @parent_name = parent.title | ||
| 34 | @parent_unique_name = parent.current_unique_name | ||
| 35 | end | ||
| 36 | end | 31 | end |
| 37 | 32 | ||
| 38 | def create | 33 | def create |
| @@ -57,10 +52,7 @@ class NodesController < ApplicationController | |||
| 57 | redirect_to(edit_node_path(@node)) | 52 | redirect_to(edit_node_path(@node)) |
| 58 | else | 53 | else |
| 59 | @selected_kind = CccConventions::NODE_KINDS.key?(params[:kind]) ? params[:kind] : "generic" | 54 | @selected_kind = CccConventions::NODE_KINDS.key?(params[:kind]) ? params[:kind] : "generic" |
| 60 | if params[:parent_id].present? | 55 | @parent = Node.find(params[:parent_id]) if params.has_key?(:parent_id) |
| 61 | @parent_id = params[:parent_id] | ||
| 62 | @parent_name = Node.find(@parent_id).title | ||
| 63 | end | ||
| 64 | render :new | 56 | render :new |
| 65 | end | 57 | end |
| 66 | end | 58 | end |
