Hi All, I am new to Ruby, Basically am a java developer. I have webservice, i want to create a view which access the webservice and display result. For that i want to create a util class which access webservice and then access that class in view. so any one can give me an idea how to do this and where do i need to place all this files in ruby on rails. Thanks in advance Chinna. -- Posted via http://www.ruby-forum.com/.
Try the RAILS_ROOT/lib directory in your rails application. You should have access to it in the view as well as other sections. On Fri, Nov 13, 2009 at 1:45 AM, Chinna Gogulapati < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi All, > > I am new to Ruby, Basically am a java developer. I have webservice, i > want to create a view which access the webservice and display result. > For that i want to create a util class which access webservice and then > access that class in view. so any one can give me an idea how to do this > and where do i need to place all this files in ruby on rails. > > Thanks in advance > Chinna. > -- > Posted via http://www.ruby-forum.com/. > > > >-- Darian Shimy --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Chinna Gogulapati wrote:> Hi All, > > I am new to Ruby, Basically am a java developer. I have webservice, i > want to create a view which access the webservice and display result. > For that i want to create a util class which access webservice and then > access that class in view. so any one can give me an idea how to do thisDon''t -- you''ll break MVC. Instead, call the Web service in the controller, store the returned data in a variable, and read that variable in the view. Have you looked at ActiveResource?> and where do i need to place all this files in ruby on rails.As others have said, the lib directory is generally a good place for utility classes that are not clearly models or helpers.> > Thanks in advance > Chinna.Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.