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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
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.
On 4 October 2013 10:03, Aneez a. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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.saveThis 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
Hi, actually I am beginner. So can you please tell where is development.log ? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ecb422339dd9a7620eae4ac3a35747fb%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.
On Fri, Oct 4, 2013 at 4:19 AM, Aneez a. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, actually I am beginner. So can you please tell where is > development.log ?Most of the time unless you are some weird ass developer it will be right there in the terminal by way of STDERR because you will preferably start a non-daemonized testing server, otherwise it will be in log/development.log relative to the root of your base Rails app. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAM5XQnzGAz20YQ-L-VbEv%3Dpg_8zj66aG%2BomXBJP4JVhEhrnrJg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
On 4 October 2013 10:19, Aneez a. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, actually I am beginner. So can you please tell where is > development.log ?In that case start by working right through a good tutorial such as railstutorial.org (which is free to use online). That will show you the basics of Rails. Do that before starting your own project, it will save you a lot of time in the long run. The log in in log/development.log though if you just want to see where you are going wrong. But then do the tutorial. Colin> > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ecb422339dd9a7620eae4ac3a35747fb%40ruby-forum.com. > For more options, visit https://groups.google.com/groups/opt_out.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvvS7zVZh4F5SPeosostSVtp6pd0vi4kZLFgAf-v3BxGw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Actually I am almost at the end of my project. If I got this I can complete my project. Thats why I asked. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e32963613ca80a2afa630ca407e5a616%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.
Run: tail -f log/development.log from your project root directory You should see the same log in the terminal where you run your server> On Oct 4, 2013, at 4:42 AM, "Aneez a." <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > Actually I am almost at the end of my project. If I got this I can > complete my project. Thats why I asked. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e32963613ca80a2afa630ca407e5a616%40ruby-forum.com. > For more options, visit https://groups.google.com/groups/opt_out.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8521BA98-466A-4C6B-8D86-0DF2086C3934%40gmail.com. For more options, visit https://groups.google.com/groups/opt_out.