Ruby on Rails Friday, October 4, 2013

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

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 ?

--
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 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/1aaf7d7fce1cce73da3df815860699da%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment