What is the best way to have a regular ruby on rails app be delivered true an IOS iphone app?
The Idea is to build, for fun and education schoolproject, an simple Iphone app that connects to the ruby on rails app for its data. Seen some articles outdated, would like to ask some advise on this server – client model for ruby and an ios app.
- How to move data from ruby app to IOS app xml ?
- How to interact from IOS app back with the Ruby on Rails Application?
- Are there opensource example apps or recent updated resources you would recommend on this topic ( gems, opensource projects, tutorials, documentations )
Also what would be good websites to checkout when doing ruby on rails and Iphone apps?
Would love to hear some feedback, I already investigated and have rough idea on above concepts but as said on older resources. Some first hand experience from you experts would be higly appreciated thx!
The general setup for a Rails backend like this could be:
Authentication: use a basic authentication sceme to authenticate to the rails backend. I would use Devise and CanCan for this, they are easy to set up and work great. If you do not want people to log in but want authentication nonetheless, you could use a token.
Push Notifications : use the APN Gem
GET data: use the GET controllers of your Rails backend, you can either specifically ask for json or just return json as default
/articles/:id.jsonIf you would want a custom JSON returned. You can override it in the model:
CREATE data: use the Create controller of you Rails backend, you can just submit like you would a form, so a
POSTwith fields likearticle[:title]=value. If you like you could return aplain textorjsonif the create was succesfull.UPDATE data: use the Update controller of your rails backend. You use a
PUThere instead of aPOST.