Hi all, I''m currently close to releasing my first rails app. Many thanks to the countless people that have helped me with my questions on this forum. Couldn''t have done it without you. So being close to release I started thinking of neat things I could do, like making an iphone app. I haven''t tried making my own iphone app yet and don''t look too forward to it honestly. So I was thinking of making an API for my rails app and let others with more experience than me give it a shot. In theory an API shouldn''t be too hard but I wanted to get the opinion of others. I''ve tried googling for this but there seems to be no good posts that I can find. Many thanks for any advice/suggestions. -Tony -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
What does your Rails application do that other developers will be interested in? If you have some neat functionality that you want others to use as a library, then release it as a gem. If your entire application does something wonderful, put in a SOAP or REST interface to it so it can be hosted as a web service. I fail to see the connection between an iPhone application and the Rails application. An iPhone application does give you a wider audience thanks to the app store. So it is worth a shot if you a have a good idea for an application. On Feb 3, 5:07 am, Tony Tony <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi all, > > I''m currently close to releasing my first rails app. Many thanks to the > countless people that have helped me with my questions on this forum. > Couldn''t have done it without you. > > So being close to release I started thinking of neat things I could do, > like making an iphone app. I haven''t tried making my own iphone app yet > and don''t look too forward to it honestly. So I was thinking of making > an API for my rails app and let others with more experience than me give > it a shot. > > In theory an API shouldn''t be too hard but I wanted to get the opinion > of others. I''ve tried googling for this but there seems to be no good > posts that I can find. > > Many thanks for any advice/suggestions. > > -Tony > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Really? Maybe updates? Maybe it''s a game that has a 3d client for it? ;) lots Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 03/02/2009, at 3:56 PM, Mukund <maruthim-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> > What does your Rails application do that other developers will be > interested in? If you have some neat functionality that you want > others to use as a library, then release it as a gem. If your entire > application does something wonderful, put in a SOAP or REST interface > to it so it can be hosted as a web service. > > I fail to see the connection between an iPhone application and the > Rails application. An iPhone application does give you a wider > audience thanks to the app store. So it is worth a shot if you a > have a good idea for an application. > > On Feb 3, 5:07 am, Tony Tony <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> Hi all, >> >> I''m currently close to releasing my first rails app. Many thanks to >> the >> countless people that have helped me with my questions on this forum. >> Couldn''t have done it without you. >> >> So being close to release I started thinking of neat things I could >> do, >> like making an iphone app. I haven''t tried making my own iphone app >> yet >> and don''t look too forward to it honestly. So I was thinking of >> making >> an API for my rails app and let others with more experience than me >> give >> it a shot. >> >> In theory an API shouldn''t be too hard but I wanted to get the >> opinion >> of others. I''ve tried googling for this but there seems to be no good >> posts that I can find. >> >> Many thanks for any advice/suggestions. >> >> -Tony >> -- >> Posted viahttp://www.ruby-forum.com/. > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> So being close to release I started thinking of neat things I could do, > like making an iphone app. I haven''t tried making my own iphone app yet > and don''t look too forward to it honestly. So I was thinking of making > an API for my rails app and let others with more experience than me give > it a shot.So you have rails app that does CRUD operations and you would like to do those as well from a native mobile application instead than the browser. Did I get it? If so what I did is to implement my app restfully and use XML to execute the CRUD operations from the terminal. I didn''t do the terminal implementation though... Is this close to what you were asking? Regards -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the replies Mukund, Julian, and Comopasta! @Mukund - I consider it to be a wonderful app ;-) I see this app being similar and no more complicated than twitterific or tweetie on the iphone. I''m thinking a SOAP/REST interface is what I will need. Also, the increased visibility of the app store wouldn''t hurt! @Julian - That game with a 3D client sounds like it would be awesome! lol @Comopasta - Yep, you got the idea! I have CRUD operations but I also have some custom methods/actions that I''d like the API to access via a native mobile app instead of the browser. Does anyone know how taxing this is on the server? I think this would be a lot easier as there are no stylesheets/javascript/images/etc. to request. Unless of course there are millions of requests, in which case it wouldn''t be too bad either ;-) Thanks again for the replies! -Tony -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''ve done some quick searches on REST API as SOAP isn''t recommended by the rails community. Came up with this site: http://hinchcliffe.org/archive/2008/01/10/16613.aspx I''ll take a more in depth look later on. If anyone else has something to contribute, feel free! -Tony -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hopefully I am not misunderstanding your intent here, so please excuse me if I am missing something. If you want an API for a Rails app then a RESTful interface is the way to go. In your controllers you need to add a respond_to directive inside each method for XML output: respond_to do |format| format.html # index.html.erb format.xml { render :xml => @pages } end And then add the appropriate XML view to each action that you want to have an RESTful interface to. You may also want to consider adding a JSON format to the respond_to block as well for the sake of convenience. You will also need to set your routes so they are mapped as Rails resources: map.resources :resource Typically if you use the scaffold or resource generators built into Rails these are generated for you and all you have to do is supply the appropriate view templates. However you should learn how to build things yourself to give you a better understanding of what it takes to generate resources in Rails. I''m sure I might be missing something in my haste, but this is the general gist of developing a RESTful interface. And yes please stay away from SOAP as was mentioned. Rails has a better way than SOAP. :-) As for the iPhone UI, you may want these: iPhoney: http://www.marketcircle.com/iphoney/ Google iUI JavaScript Library: http://code.google.com/p/iui/ If possible, you may want to pickup a copy of the following book as well: http://www.pragprog.com/titles/fr_arr/advanced-rails-recipes This covers some advanced topics, but two of the recipes in the title explain how to create a RESTful resource (or resources) and how to support an iPhone UI using the Google iUI library linked to above. Hope this helps at least a little. :-) On Feb 2, 7:07 pm, Tony Tony <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi all, > > I''m currently close to releasing my first rails app. Many thanks to the > countless people that have helped me with my questions on this forum. > Couldn''t have done it without you. > > So being close to release I started thinking of neat things I could do, > like making an iphone app. I haven''t tried making my own iphone app yet > and don''t look too forward to it honestly. So I was thinking of making > an API for my rails app and let others with more experience than me give > it a shot. > > In theory an API shouldn''t be too hard but I wanted to get the opinion > of others. I''ve tried googling for this but there seems to be no good > posts that I can find. > > Many thanks for any advice/suggestions. > > -Tony > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Billee D. wrote:> Hopefully I am not misunderstanding your intent here, so please excuse > me if I am missing something. >Hi Billee and thank you for the help! So far I have all of that pretty much learned. My question (and maybe I''m misunderstanding this greatly) is how to make an API for native mobile apps to access. XML might be part of the answer but I''m not so sure about that. Most applications with an API require a key (usually a unique and random 16-26 character alphanumerical code) to confirm you are authorized to access the account. I''m sure this key could be substituted by a username and password (like twitterific for example). Once this native mobile app is authorized to access the account it can do pretty much anything someone on the website is allowed to do. Create, Remove, Update, and Destroy (CRUD) operations and access some custom actions as well such as adding friends. Thanks. -Tony -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> Most applications with an API require a key (usually a unique and random > 16-26 character alphanumerical code) to confirm you are authorized to > access the account. I''m sure this key could be substituted by a username > and password (like twitterific for example). Once this native mobile app > is authorized to access the account it can do pretty much anything > someone on the website is allowed to do. Create, Remove, Update, and > Destroy (CRUD) operations and access some custom actions as well such as > adding friends.Hi, yeah keys are one option. I''m using restful_authentication and I modified the plugin by adding some methods to handle the XML calls from the mobile. Regarding the keys I actually reused the cookie functionality of the same plugin, so for the mobile I set a long expiration for the cookie and the client can use the API for as long that is valid (logged in). I don''t have the code here but I could post my changes here, I would maybe get some feedback about my approach as well :-) As Billee D. mentioned adding the XML response featyre to the rails app is very simple and JSON is also a possibility. I think it also depends on what is easier to parse and consume for you on the terminal side. Cheers. -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---