Not sure that this is the only problem, but a couple of things pop out
at me ...
On Tue, 2009-03-10 at 08:26 -0700, bbtosurf wrote:
> I am sorry here it is again:
>
> I have tried posting to test method and it doesn't do anything. The
> browser stays on waiting for response...and after a couple of minutes
> I get this:
>
> Timeout::Error in BuildsController#create execution
> expired
>
> def create
I don't think it's the source of your current problem since the POST is
happening, but it's more typical for the files in the require lines to
be loaded when the Class is loaded, rather than when a method is
invoked. I'd move them outside the method.
> require 'net/http'
> require 'uri'
> @build = Build.new(params[:build])
> if @build.save
> res = Net::HTTP.post_form(URI.parse('http://localhost:3000/apps/1/
> build'), {'q'=>'ruby', 'max'=>'50'})
> end
> end
Two things:
1) Assuming we're inside the BuildsController, are you sure you've got a
route that maps the url above (/apps/1/build) to {:controller =>
'builds', :action => 'test'} ?. Use rake:routes to see.
2) You're posting to your own app. In development mode you're probably
running one Mongrel. That mongrel is tied up in the 'create' method
waiting for your POST to get a response. It cannot process the request
in your 'test' method because it's stuck waiting, in the 'create'
method, until it receives the response to that request.
HTH,
Bill
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---