- def rest
- unless Node.exists?(params[:id])
- render :nothing => true, :status => 400
- return
+ def read
+ begin
+ node = Node.find(params[:id])
+
+ if node.visible
+ render :text => node.to_xml.to_s, :content_type => "text/xml"
+ else
+ render :nothing => true, :status => :gone
+ end
+ rescue ActiveRecord::RecordNotFound
+ render :nothing => true, :status => :not_found
+ rescue
+ render :nothing => true, :status => :internal_server_error