# Routes.rb structure

**URL:** <https://meta.discourse.org/t/routes-rb-structure/53397>\
**Category:** Development\
**Created:** [26 Novembre 2016, 1:35pm UTC](https://meta.discourse.org/t/routes-rb-structure/53397 "2016-11-26T13:35:39Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Alavi1412](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alavi1412/32/67721_2.png) [@Alavi1412](https://meta.discourse.org/u/Alavi1412)\
**Post date:** [26 Novembre 2016, 1:35pm UTC](https://meta.discourse.org/t/routes-rb-structure/53397/1 "2016-11-26T13:35:39Z")

</div>

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 :

```plaintext
get 'recom/recom'
resources :recom do
      member do
          get 'recom/req'
      end
  end

```

and my recom controller:

```plaintext
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

---

_[View the full topic](https://meta.discourse.org/t/routes-rb-structure/53397)._
