summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-04-16 12:14:45 +0200
committerhukl <contact@smyck.org>2009-04-16 12:14:45 +0200
commit7fe358bfb11f1cba4ee9237c4ef4b7efc3cfba87 (patch)
treea4ee5095b0ff151891d0ec402dc5b00bedb9a565 /app/controllers
parent7176edae9b93eb00e7982ec2d9a69f5b28633907 (diff)
added autosave to node edit view. saves every 15 seconds
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/nodes_controller.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb
index 1796090..aba132b 100644
--- a/app/controllers/nodes_controller.rb
+++ b/app/controllers/nodes_controller.rb
@@ -58,8 +58,11 @@ class NodesController < ApplicationController
58 @draft = @node.find_or_create_draft current_user 58 @draft = @node.find_or_create_draft current_user
59 @draft.tag_list = params[:tag_list] 59 @draft.tag_list = params[:tag_list]
60 if @draft.update_attributes( params[:page] ) 60 if @draft.update_attributes( params[:page] )
61 flash[:notice] = "Draft has been updated" 61 flash[:notice] = "Draft has been saved: #{Time.now}"
62 redirect_to edit_node_path(@node) 62 respond_to do |format|
63 format.html { redirect_to edit_node_path(@node) }
64 format.js
65 end
63 else 66 else
64 render :action => :edit 67 render :action => :edit
65 end 68 end