# Ajax post from a mobile app

**URL:** <https://www.ruby-forum.com/t/ajax-post-from-a-mobile-app/189672>\
**Category:** Rails\
**Created:** [June 4, 2010, 8:44pm UTC](https://www.ruby-forum.com/t/ajax-post-from-a-mobile-app/189672 "2010-06-04T20:44:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bc79bd/32.png) [@gregm](https://www.ruby-forum.com/u/gregm)\
**Post date:** [June 4, 2010, 8:44pm UTC](https://www.ruby-forum.com/t/ajax-post-from-a-mobile-app/189672/1 "2010-06-04T20:44:58Z")

</div>

Hi,  
I’m a trying to create a user using Ajax from a mobile app with  
javascript and I’m struggling!!!

Here is what I’m trying:  
user = {username:‘plop’, password:‘plip’, password\_confirmation:‘plip’};  
new Ajax.Updater(‘all’, HOST + ‘users/create’,{  
method: ‘POST’,  
parameters:{‘user’: user}  
});

When I look at the log It seems that is doesn’t recognize first that is  
a POST method and it doesn’t recognize my user parameter.

Here is the log:  
Processing UsersController#create (for 127.0.0.1 at 2010-06-04 20:40:07)  
[OPTIONS]  
Parameters: {“action”=\>“create”, “controller”=\>“users”}

Here is how it should be:  
Processing UsersController#create (for 127.0.0.1 at 2010-06-04 20:35:46)  
[POST]  
Parameters: {“commit”=\>“Submit”, “action”=\>“create”,  
“authenticity\_token”=\>"/fkA8CQVp88xDB1Tbf/T2OHldbpc0QQlsBk7yk/7mxA=",  
“controller”=\>“users”, “user”=\>{“password\_confirmation”=\>"[FILTERED]",  
“username”=\>“toto”, “password”=\>"[FILTERED]"}}

Greg
