At 01:42 PM 8/4/2009, Dean wrote:
>I believe the problem is the "return" statement (with no args) after 
>the redirect_to

Doesn't make a difference. Darn.

Matt:

No joy with '/my/video/list'. There is some Javascript, so I tried 
turning off Javascript, no change. I replaced the contents of 
list.html.erb with a single line of unformatted text, no difference. 
That renders correctly when its url is manually entered into the browser.

Initiating controller, in /app/controllers/another_controller.rb:

   def upload
     redirect_to :controller => '/my/video', :action => :list
     return
     # .. more code
   end

redirected to, in /app/controllers/my/video_controller.rb:

   def list
     # get user, compositions, thumbnails
     @user = User.find(current_user.id, :include => [ :profile ] )
     @compositions = @user.compositions.find( :all, :include => [ :video ] )
     @thumbnails = []
     for composition in @compositions
       @thumbnails << @s3media.get_url(composition.thumbnail)
     end
     # render :action => :list  # makes no difference
   end

Tried putting the last render line, with a return after it, at the 
top so the controller doesn't do anything. No difference. The view 
still renders properly (with its one line of text) when entered manually.

This was created as the first Rails project of an experienced 
programmer, who abandoned it for another project ("It only needs a 
few fixes"---good thing I'm paid by the hour). I think he reached 
this point and went back to PHP or Java. Since my only web 
development environment is Rails, I'm stuck. :) (Oh, wait, there's Sinatra...)

I keep thinking he changed some setting that matters, but controller 
caching is turned off in development.rb, and I don't see anything 
else suspicious. Maybe Rails 2.0.2 has a problem.

Thanks again,

Scott


At 12:27 PM 8/4/2009, you wrote:
>Try: redirect_to "/my/video/list" also, if that doesn't work, please 
>the entire action.
>
>- Matt
>
>Sent from my iPhone
>
>On Aug 4, 2009, at 11:27, Scott Olmsted 
><<mailto:[email protected]>[email protected]> wrote:
>
>>
>>I'm fixing bugs in an existing Rails 2.0.2 app and trying to do a 
>>redirect after an upload of some info:
>>
>>RAILS_DEFAULT_LOGGER.info(">>>>>>>>>   redirect_to :controller => 
>>'/my/video', :action => 'list'")
>>redirect_to :controller => '/my/video', :action => 'list'
>>return
>>
>>But although the log says it worked:
>>
>> >>>>>>>>>   redirect_to :action => 'list', :controller => 'my/video'
>>Redirected to 
>><http://localhost:3000/my/video/list>http://localhost:3000/my/video/list
>>Completed in 0.03208 (31 reqs/sec) | DB: 0.01528 (16%) | 302 Found 
>>[ <http://localhost/my/video/upload>http://localhost/my/video/upload]
>>
>>...(SQL calls logged here)...
>>
>>Rendering template within layouts/application
>>Rendering my/video/list
>>
>>the new page is not rendered. The status line of the browser 
>>displays 'Waiting for localhost', then 'Done'.
>>
>>Manually entering 
>><http://localhost:3000/my/video/list>http://localhost:3000/my/video/list 
>>into the browser produces the desired page.
>>
>>I've already tried changing 'list' to :list and 'my/video' to 
>>:"my/video" without effect. I've also commented out all the upload 
>>code so that essentially nothing is done before the redirect. 
>>Routes are not even REST, just plain old
>>
>>map.connect ':controller/:action/:id'
>>
>>I've cleared the browser cache. And of course I've googled till I'm 
>>tired of googling.
>>
>>Any ideas?
>>
>>Thanks much.
>>
>>Scott
>>
>>P.S. So who's coming to the barbecue Saturday? Burgers, beer, wine, 
>>munchies--tell us what you're bringing.
>
>
--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---

Reply via email to