I have two rails application. On clicking a link on Application 1''s index.html.rb page I wish to do some processing like retreiving info about the selected record from DB. and then make a call to a different rails application. Do I need to write code in my view using helper functions or I can do this in controller. I wish to do this in controller.. as it will mean a cleaner code in view. Is there some dispatch mechanism available in Rails controller. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
What exactly does "make a call to a different rails application" mean? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sharagoz -- wrote:> What exactly does "make a call to a different rails application" mean?For example I wish to call www.google.com with some parameters from my rails application then what should I do. I am firing some soap requests to get those input parameters for google. Hence I need to write some code in my controller. Something like I am calling show function of scaffold generated project and there I am calling google.com iso default show.html created by scaffold -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Then you can use ''net/http'' to send a regular http request, like so: require ''net/http'' connection = Net::HTTP.new("www.google.com") response = "" connection.start do |http| req = Net::HTTP::Get.new("/#hl=en&source=hp&q=ruby+on+rails&fp=c26c79a56c95bda8") response = http.request(req) end #do something with response This can of course be put in the controller, but also the model if that suits you better. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sharagoz -- wrote:> Then you can use ''net/http'' to send a regular http request, like so: > > require ''net/http'' > > connection = Net::HTTP.new("www.google.com") > response = "" > connection.start do |http| > req = > Net::HTTP::Get.new("/#hl=en&source=hp&q=ruby+on+rails&fp=c26c79a56c95bda8") > response = http.request(req) > end > #do something with response > > This can of course be put in the controller, but also the model if that > suits you better.How can I open the page in a new browser. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Prashant Thakur wrote:> Sharagoz -- wrote: >> Then you can use ''net/http'' to send a regular http request, like so: >> >> require ''net/http'' >> >> connection = Net::HTTP.new("www.google.com") >> response = "" >> connection.start do |http| >> req = >> Net::HTTP::Get.new("/#hl=en&source=hp&q=ruby+on+rails&fp=c26c79a56c95bda8") >> response = http.request(req) >> end >> #do something with response >> >> This can of course be put in the controller, but also the model if that >> suits you better. > > How can I open the page in a new browser.Basically I wish to open the 2nd page by specifying its url and parameters in a different window by clicking a link in first application this link will call the controller function where soap requests will be sent to server and based on that reponse I open a new website with parameters. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I see. Can''t you just put :popup => true on the link in the view, and then use a redirect_to in the controller? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sharagoz -- wrote:> I see. Can''t you just put :popup => true on the link in the view, and > then use a redirect_to in the controller?Thanks. The solution works as it opens the required page. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.