Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

creating an iphone app with a ruby on rails backend

After studying ruby on rails l love and was thinking of creating an iphone app. But confused how to approach it as l want the web version of the app and the iphone app version to have the same database. l was thinking of building an API into the rails app and use that to pull information into my iphone app. is that right or any ideas?

Jason Seifer Jim Hoskins Ben Jakuben Amit Bijlani

1 Answer

Nathan F.
Nathan F.
30,773 Points

Building a web API that powers both the Rails site and a native iOS app seems like the right approach to me. Presumably you'd use that API to serve up JSON or similarly formatted data to iOS, which would plug that into appropriate models. Is this data something that will update itself frequently, or only sometimes? How large is the data? You should consider those questions in your approach too, as you should consider whether you need to frequently poll the API for data changes, or whether to have some kind of local storage on the iOS device.

Thanks for the comment Nathan Fulkerson the data would just of user models with a possibility of growing and updating. Local storage seemed like a choice but could not figure out how to keep that and my web app in sync.