On 4 October 2013 10:03, Aneez a. <lists@ruby-forum.com> wrote:
> I want to save four fields(name,latitude,longitude,location) coming from
> my android phone to mysql table through ruby. I did the follwing code in
> my update file.
>
> def update
>
> @trackdata_items=Trackdata.new(params[:trackdata_items])
>
> if @trackdata_items.save
This looks more like a create action than an update action.
>
> render :text => '{
> "success":true,
> "info":"ok",
> "data":{
> "tasks":[
> {"title":"Complete the app"}
> ]
> }
> }'
>
>
> else
> render :status => :unprocessable_entity,
> :json => { :success => false,
> :info => resource.errors,
> :data => {} }
> end
>
>
> end
>
>
> But my sql database is updating each time with NULL values. what to do ?
First look in development.log to see what parameters are being posted
and which action is called.
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLubLJzwMyNddg88JQpDwC7f4pyNqs3PoxtyFNXGSUi5Rw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment