Skip to content

Commit

Permalink
Added support for batch node create/update using zjs.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspard committed May 15, 2012
1 parent 7950f05 commit c8cf814
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 93 deletions.
5 changes: 5 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
== 1.2.2

* Major changes
* Basic zjs to batch create/update nodes (with grid.js)

== 1.2.0, 1.2.1 2012-05-01

* Major changes
Expand Down
11 changes: 9 additions & 2 deletions app/controllers/nodes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def destroy
end
end

format.xml do
format.xml do
node_xml = @node.to_xml #need to be allocated before destroying
if node_xml && @node.destroy
render :xml => node_xml, :status => 200
Expand All @@ -305,7 +305,14 @@ def destroy
end
end

format.js
format.js do
node_json = @node.to_json
if @node.destroy
render :json => node_json, :status => 200
else
render :json => @node.errors, :status => :unprocessable_entity
end
end

end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/zena/info.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Zena
VERSION = '1.2.1'
VERSION = '1.2.2'
ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
end

0 comments on commit c8cf814

Please sign in to comment.