0
Id:<input type="text" id="id" required="required"></br>
Name:<input type="text" id="name" required="required"></br>
<input type="submit" id="submit">

I have a form, where i have placed the above code. And now i can give values. What i need is, i have to send the value that i give in the text box to an api in a specific format as shown below.

{ "entry":
      { "id":"",
        "name":""
      }
} 

I have to do it using ruby. I am not using rails or any other framework. How can i do this? If possible give me some code examples.

  • [You can’t do that with plain HTML.](http://stackoverflow.com/a/11024387/53114) – Gumbo Jul 07 '12 at 10:24
  • Can you be more specific. Are we talking rails here? Basically if its on the client your talking JS, so have a look at jquery. – Roger Aug 22 '12 at 06:49

0 Answers0