nesquena/rabl — Issue #156: TimeOut::Error when trying to access to JSON file
Author: picsoung
Created: 2012-01-27 02:07:44+00:00
State: open

Hello guys :)

Today I tried to use Rabl for the first time to help me generate JSON file easily.

So I have got in my controller a show function like that
```ruby
def show
@agencies = Agencies.all

respond_to do |format|
format.html # show.html.erb
format.json
end
end
```

and a show.json.rabl file like that
object @agencies

attributes :id, :name, :email

```ruby
child :advertisers do
attributes :id, :name,:email
child :campaigns do
attributes :id,:name
begin
child :banners do
attributes :id, :name
end
end
end
end
```

When I access to http://localhost:3000/mycontroller/stats.json on my browser it load the coresponding JSON file

But I am trying to access it in the controller like that
```ruby
url = "http://localhost:3000/mycontroller/stats.json"
resp = Net::HTTP.get_response(URI.parse(url))
@data = resp.body
```

I got a Timeout::Error after a while...
In the console those lines work.

Do you have any advice ? is this problem happened before ?

thanks for your help