mobile app JSON calls to controller

30 views
Skip to first unread message

Brandon

unread,
Feb 25, 2014, 6:43:52 AM2/25/14
to rubyonra...@googlegroups.com
Hi,

I've controller methods which my mobile app calls to retrieve JSON.

I'm curious what is the best practice in naming mobile methods? Do I put all the mobile calls into a new controller? Right now I'm only prependng 'mobile_' in front of the methods like session/mobile_create.

Right now the mobile functions are quite different from the Web ones. So a sessions/create VS sessions/mobile_create is different and so mobile_create news to exist.




mike

unread,
Feb 26, 2014, 3:44:24 PM2/26/14
to rubyonra...@googlegroups.com
I'm not sure I understand exactly what you're doing, but I'm assuming when you refer to a mobile app you mean a rails app running on a mobile device (as opposed to an app developed in Cocoa or Android that is accessing your API).  In that case, I would recommend Rails 4.1 as they have developed a standard that is a lot easier to use.  Look at the section "ActionPack Variants" at the following link:

Brandon

unread,
Feb 26, 2014, 9:34:21 PM2/26/14
to rubyonra...@googlegroups.com
Thanks for the link Mike. Actually I my mobile app is using PhoneGap. So it does JSON calls to my User controller.

Been looking for a better way to organise the methods. Right now in addition to Create, I also have Mobile_create in the User controller because Mobile_create is slightly different from Create.
Reply all
Reply to author
Forward
0 new messages