johnmcauley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Jun-10 16:24 UTC
Rest with ruby objects?
Hello Everyone, Does anybody know how to use rest to deliver non-active record models in rails 2.3.2. I am using flex as a front end for a huge data set and I end to crunch the numbers on the back end before passing arrays of counts through to the visualisation. Any help greatly appreciated.
johnmcauley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Hello Everyone, > > Does anybody know how to use rest to deliver non-active record models > in rails 2.3.2.[...] Just set up a suitable controller (with RESTfully named methods), and get the data from wherever you need it. Then send it out as JSON, XML, or whatever you need. REST is really all about naming and conceptual architecture. It doesn''t have much directly to do with ActiveRecord. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
johnmcauley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Jun-10 18:56 UTC
Re: Rest with ruby objects?
Thanks for your reply. How would I get a count without passing an entire array of objects? j On Jun 10, 7:29 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote:> johnmcau...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > Hello Everyone, > > > Does anybody know how to use rest to deliver non-active record models > > in rails 2.3.2. > > [...] > > Just set up a suitable controller (with RESTfully named methods), and > get the data from wherever you need it. Then send it out as JSON, XML, > or whatever you need. > > REST is really all about naming and conceptual architecture. It doesn''t > have much directly to do with ActiveRecord. > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.
johnmcauley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Thanks for your reply. > > How would I get a count without passing an entire array of objects?Call #size on the array before passing it? Or am I misunderstanding what you want?> > jBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
johnmcauley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Jun-11 09:11 UTC
Re: Rest with ruby objects?
Hey Marmen, Thanks for your reply. I want to run several queries aganist a database. These queries will return arrays of objects contistong of value, key pairs. These objects are not activerecord objects, and basically are values I''ll use to create graphs in flex. This was very easy with aws. I could use structs, query, build the array and serve with aws. But aws is gone. I''m having trouble doing this with rest. Do I need a count controller, and use list with some parameter to specify the query? And if I use a simple ruby object I run into XML serialization problems. Have any suggestions on how to go about this? Thanks again, j On Jun 10, 10:03 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote:> johnmcau...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > Thanks for your reply. > > > How would I get a count without passing an entire array of objects? > > Call #size on the array before passing it? Or am I misunderstanding > what you want? > > > > > j > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.
Have you had a look at http://restfulx.github.com? On Wed, Jun 10, 2009 at 6:24 PM, johnmcauley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org < johnmcauley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello Everyone, > > Does anybody know how to use rest to deliver non-active record models > in rails 2.3.2. I am using flex as a front end for a huge data set > and I end to crunch the numbers on the back end before passing arrays > of counts through to the visualisation. > > Any help greatly appreciated. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
johnmcauley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Jun-11 10:34 UTC
Re: Rest with ruby objects?
I haven''t but I will. Thanks, J On Jun 11,, 10:18 am, Webdevotion <webdevot...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Have you had a look athttp://restfulx.github.com? > > On Wed, Jun 10, 2009 at 6:24 PM, johnmcau...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org < > > johnmcau...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello Everyone, > > > Does anybody know how to use rest to deliver non-active record models > > in rails 2.3.2. I am using flex as a front end for a huge data set > > and I end to crunch the numbers on the back end before passing arrays > > of counts through to the visualisation. > > > Any help greatly appreciated.