I have two app in rails that communicate between net/http:
In the first app controller is something like so:
class WebservicesController < ApplicationController
require 'net/http'
require "uri"
layout 'admin'
def ws
uri = URI("http://localhost:3001/api/ws")
response = Net::HTTP.post_form(uri, {'campaign_id' => '1'})
debugger
@res = response
respond_to do |format|
format.html
end
end
end
In the second app controller is like that:
class ApiController < ApplicationController
def ws
begin
debugger
req =Smsq.find_by_campaign_id(params[:campaign_id])
return req
rescue Exception => exception
return "NOK : #{exception.message}"
end
end
end
But response return: `#<Net::HTTPOK:0x000000090ab708>`
But how can i get the result for this query
`Smsq.find_by_campaign_id(params[:campaign_id])` in my first app??
I have result when i try to the console.
Thank you
--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/01a3b9c0bc6808f6ca2cf94e7905bf73%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment