Changeset 7064
- Timestamp:
- 06/19/07 18:40:28 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activeresource/lib/active_resource/connection.rb
r6864 r7064 72 72 # Used to update resources. 73 73 def put(path, body = '', headers = {}) 74 request(:put, path, body , build_request_headers(headers))74 request(:put, path, body.to_s, build_request_headers(headers)) 75 75 end 76 76 … … 78 78 # Used to create new resources. 79 79 def post(path, body = '', headers = {}) 80 request(:post, path, body , build_request_headers(headers))80 request(:post, path, body.to_s, build_request_headers(headers)) 81 81 end 82 82 trunk/activeresource/lib/active_resource/custom_methods.rb
r6625 r7064 40 40 end 41 41 42 def post(method_name, options = {}, body = nil)42 def post(method_name, options = {}, body = '') 43 43 connection.post(custom_method_collection_url(method_name, options), body, headers) 44 44 end 45 45 46 def put(method_name, options = {}, body = nil)46 def put(method_name, options = {}, body = '') 47 47 connection.put(custom_method_collection_url(method_name, options), body, headers) 48 48 end … … 75 75 end 76 76 77 def post(method_name, options = {}, body = nil)77 def post(method_name, options = {}, body = '') 78 78 if new? 79 79 connection.post(custom_method_new_element_url(method_name, options), (body.nil? ? to_xml : body), self.class.headers) … … 83 83 end 84 84 85 def put(method_name, options = {}, body = nil)85 def put(method_name, options = {}, body = '') 86 86 connection.put(custom_method_element_url(method_name, options), body, self.class.headers) 87 87 end