hi
I have a controller and action but my action don’t render any thing .it just send some json to some where.
my routs.rb :
get 'recom/recom'
resources :recom do
member do
get 'recom/req'
end
end
and my recom controller:
def index
render('recom/recom')
end
def req
require 'net/http'
require 'json'
uri = URI("http://80.85.203.33:321/ingest?id=1122&url=%27t54646%27");
req = Net::HTTP::Get.new(uri);
res = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(req);
end
end
and my error is:
The action ‘show’ could not be found for RecomController
and when I put show function without render it says it couldn’t run blank template.
when I put render inside of req function .It works fine but I don’t want to render any thing I just want to run a code on every request sent to controller