I am trying to post from C# to a simple Ruby on Rails page.
I am using the cookbook of Ruby on rails. So I just want to create a new
category from C#
I do it like this in c#

string url = "http://localhost:3000/categories.xml";;
oPostData = ASCIIEncoding.UTF8.GetBytes("category=TestCat");
ie.Navigate2(ref oURL, ref oEmpty, ref oEmpty, ref oPostData, ref
oHeader);


I get this

NoMethodError in CategoriesController#create
undefined method `stringify_keys!' for "TestCat":String
RAILS_ROOT: C:/InstantRails/rails_apps/cookbook

C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2111:in
`attributes='
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1926:in
`initialize'
app/controllers/categories_controller.rb:43:in `new'
app/controllers/categories_controller.rb:43:in `create'

Request
Parameters:

{"format"=>"xml",
 "category"=>"TestCat"}

Show session dump

---
:csrf_id: 5dc6b3aa43b099703c798ea053ad9ebb
flash: !map:ActionController::Flash::FlashHash {}

Response
Headers:
{"cookie"=>[],
 "Cache-Control"=>"no-cache"}



I think I am not supposed to pass the parameter that way. Can anybody
show me where and how I am supposed to post on this. Any help will be
appreciated .
Thanks in advance
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to