HI all, I am working on a huge project right now, and i wish to use dynamic error pages (404, 500, etc.). I followed the the tutorial on the Rails wiki and attached this code to my application.rb: def rescue_action_in_public(exception) @exception = exception render :file => ''public/404.rhtml'', :layout => ''picpongstore'' end def local_request? false end and to /config/enviroments/development.rb: config.action_controller.consider_all_requests_local = false anyway, 404 errors are handled great, but application-errors (aka 500) are still displayed like before (text messages only). any ideas? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mon, 2007-01-15 at 09:41 +0100, Elad Meidar wrote:> HI all, > > I am working on a huge project right now, and i wish to use dynamic > error pages (404, 500, etc.). > I followed the the tutorial on the Rails wiki and attached this code to > my application.rb: > > def rescue_action_in_public(exception) > @exception = exception > render :file => ''public/404.rhtml'', :layout => ''picpongstore'' > end > > def local_request? > false > end > > and to /config/enviroments/development.rb: > > config.action_controller.consider_all_requests_local = false > > anyway, 404 errors are handled great, but application-errors (aka 500) > are still displayed like before (text messages only). > > any ideas? >If you switch to rails-1.2 RC-2, "Uncaught exceptions raised anywhere in your application will cause RAILS_ROOT/public/500.html to be read and shown instead of just the static Application error (Rails). So make it look nice if you arent using it already!" No more fooling around with rescue_action_in_public is required now. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
mmm, but this is a 500.HTML, not RHTML. so i will not be able to use dynamic data, or even layout. that''s not very DRY. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Anyone know why this was done and/or what the benefit is of it? Elad Meidar - Creopolis.com wrote:> > mmm, > > but this is a 500.HTML, not RHTML. so i will not be able to use dynamic > data, or even layout. > that''s not very DRY. > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
If you get a 500, you can''t be sure your server is really working right. A 500 is a server error so your Rails app might be hosed. It''s probably safer to render an html page than try to rely on the app to do something smart. Jason Norris wrote:> > > Anyone know why this was done and/or what the benefit is of it? > > Elad Meidar - Creopolis.com wrote: >> >> mmm, >> >> but this is a 500.HTML, not RHTML. so i will not be able to use dynamic >> data, or even layout. >> that''s not very DRY. >> >> >> > >> > > > > > >-- View this message in context: http://www.nabble.com/-Rails--Dynamic-Error-Pages-tf3013402.html#a8376254 Sent from the RubyOnRails Users mailing list archive at Nabble.com. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hemant Kumar wrote:> On Mon, 2007-01-15 at 09:41 +0100, Elad Meidar wrote: >> end >> are still displayed like before (text messages only). >> >> any ideas? >> > > If you switch to rails-1.2 RC-2, > > "Uncaught exceptions raised anywhere in your application will cause > RAILS_ROOT/public/500.html to be read and shown instead of just the > static Application error (Rails). So make it look nice if you aren t > using it already!" > > No more fooling around with rescue_action_in_public is required now.Ok, but this is an HTML file, not RHTML... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---