Unfortunately I don't have a good recipe, but I'm trying to develop something similar (API for my Rails application) and here are my unpretentious results. I have made a standalone ruby script and include Rails configuration there: require File.dirname(__FILE__) + '/../config/environment' Thus I have access to all models and their connections.
I have mod_rails + Ruby Enterprise installed, but this API script works as CGI and doesn't use Ruby Enterprise gems, so you need to install the same list of gems for normal Ruby and Ruby Enterprise. Another way is to add a line in your Apache config: RailsSpawnMethod conservative But somebody claims that it's too slow. Another tip is to check for the same ENV['RAILS_ENV'] value for both Rails and API script, because Passenger overwrites it. Currently I'm researching different approaches in optimizing speed of my application. I'm going to make the API script as a daemon, there are some great tools in Ruby for that. But I didn't select any and cannot comment them. A bit messy, sorry :) Maybe this helps. Nevertheless it will be great to share good experience. On 7 сент, 04:40, Charles Ju <[EMAIL PROTECTED]> wrote: > Hi! > > I'm a new developer trying to get into Ruby on Rails. My team is > developing an iPhone application that wants to call our Ruby on Rails > web-end to store and retrieve data. I've looked on the web and in this > forum but the only things I could find were dealing with scaffolding, > which a) didn't solve the problem clearly for me and b) we're not > using scaffolding. > > So, I was wondering what would be the best way to create such an API, > and how can we do it securely? > > Thanks! > > - Charles --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

