I am trying to add a controller method that will take an XML post with a schema not related to an existing model and parse it as a hash of parameters. I create apis_controller.rb:
class ApisController < ApplicationController def create puts "**** API INVOKED ****" puts params[:name] end end
Then...
curl --data-urlencode "<name>Foo</name>" -H "Content-Type:application/ xml" http://localhost:3000/apis.xml
I get the following error:
Status: 500 Internal Server Error undefined method `name' for nil:NilClass
Is there a way for "puts params[:name]" to display "Foo" upon receiving the XML post?
Thanks in advance! Mark